From patchwork Fri Jan 6 10:07:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 40066 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp744141wrt; Fri, 6 Jan 2023 02:12:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXsRtacffuIdsxJ+XEEdkDo+MJeItyaCHZ7Zbe+vq9o1dyMHa16PCgnQK73LpFDlrkIQZkSM X-Received: by 2002:aa7:c69a:0:b0:47d:674e:aca with SMTP id n26-20020aa7c69a000000b0047d674e0acamr45558211edq.19.1672999973274; Fri, 06 Jan 2023 02:12:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672999973; cv=none; d=google.com; s=arc-20160816; b=Hg4pzRQRhdzZZfBdR8urXU19QciaRSv5MaAJk3Vl+9CYm1LBfZ27QYO/+40M7eevXm zrPzdlMxIkRwWdRLAJJ/JVazdKnD5ZkDGTexydtlzGTh9QWILOr5OZp+maAn/jCLyC+b 61Ji1cNjnpFCJ0zNAfo3QKYuU2aCENhz9mghHq0J6+aW4GD9AzXSxEUrbCPO1MsQnoee Q8tKONoEwZ0fSuel3L/hrItYDoy16V0Z1lYd15U8ND9hA5jN9CcF6Pr6of+7Ub1cL8Gu vqebzTDU1LiNvWjiWLCYQ6WTRXG4nd1IhtpUdgRwpVPMzGt6koPSBPHagYyb1PioZSgP ryLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=t3R1Lbe2HL6UDHx8NRIcdd2REVBcn4pDKMIH3jzsR7A=; b=sPazI7BY0UdPkp0vTSkWw42GpGFzGSiEytSpXr8WmeYM7RTZo8HuyzkK2aPb4gflM2 FDoH3eCSdVw3HjenV7eT7KbvK47LOb2AkbGuAbCuepjXgQMQSBZYvzuWIjO2M7ipzU/H IRV4AQs1CxYzm+Ku1K6DosTH2aRLTb7WT2SyTRFprLIKZe41C/8jYUzE/R/bPOiFzq0h vQQm0yM+tguVus/WFmcVQuRnF4aiuiup47qmJfaX36UA4PiQpKmHC++c09f51AImw1ep /BKgM5dc6AkgWjO6AT0Qi9ap4xXj++4j32jyysdQlr/qb1r9j3Ouqy7GuAlzfdzub/g4 bdUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=t2Grv2Rj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d20-20020aa7d5d4000000b0047ed1256ff6si1154832eds.443.2023.01.06.02.12.29; Fri, 06 Jan 2023 02:12:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=t2Grv2Rj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233027AbjAFKH3 (ORCPT + 99 others); Fri, 6 Jan 2023 05:07:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjAFKH0 (ORCPT ); Fri, 6 Jan 2023 05:07:26 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56D431C409 for ; Fri, 6 Jan 2023 02:07:23 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id d4so826914wrw.6 for ; Fri, 06 Jan 2023 02:07:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=t3R1Lbe2HL6UDHx8NRIcdd2REVBcn4pDKMIH3jzsR7A=; b=t2Grv2RjFdeGtq9774/UemXRj4+qjHeiqrmMNUZMRC0IGIQkFZjDsN7sy0cZn/Vi/E SdBqKqOt6WZKOcDhIvpOAHsGnU6tkY1iD67by2dplh8Yn9Vxd7QgZsLSvl749N29FXPL YDC0hoc5PEXbuCSVFcy5GgkOMbDaGQ+rle4eyd82OoGiPxyilXlpT5Es+hzOLEWhn85l HHBHgD4A29ke5YDnaJymUjI5OMtZX8jg6AscvIYM+ro540c8M7LqaJSwA99P+q4Awmj9 0RHELIKRGbNtHRddj9EanUODcqPosluBqM1aiOREsLpgGzBcx6R/OPuZbVkYQEhpTO6A XgfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=t3R1Lbe2HL6UDHx8NRIcdd2REVBcn4pDKMIH3jzsR7A=; b=wg1H/nm8LGxiUzw+DL8cHOU8w31d0T4Roy/gFoTLBobyZzToVjdQEurHuwwuQuup5C fHJbxglW4x2b39J1DHwRyhh71UjRJMTckr/Y/tcZWxX3XKji0G5sCzCjof94y0dQBAQs pe8qh1CKeYY7rBkj4aBOuVVuyc60lpPJ13jOkL8FBk56G3RSsh/XeA8rblmqwUVdpdyX Ef16dpreHV3cVVxuht2RW+KXbL0qhR/sr9gIbMwqbVCamnWVZp6umuw/lXxPu2dGpr7N 2oZ3DYm+M4p2q2zEIXhp7UQrGh9wQRmEBxX5nMQvGb5fhEF4RUIpZTr6/4lScSeneEQk leJQ== X-Gm-Message-State: AFqh2krRf6OEG/7iMOFpA+NdPD4VnyBY7Jqz4LnN527hKFG9zA+kaojG Vut0LiJ3tz0WaO1w4iiq57FBbb/z2VAh2Ggo X-Received: by 2002:a5d:4f06:0:b0:274:a10d:f1ac with SMTP id c6-20020a5d4f06000000b00274a10df1acmr29764024wru.27.1672999641788; Fri, 06 Jan 2023 02:07:21 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:86fd:399:3851:d474]) by smtp.gmail.com with ESMTPSA id f2-20020adfdb42000000b0024274a5db0asm780594wrj.2.2023.01.06.02.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 02:07:21 -0800 (PST) From: Bartosz Golaszewski To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 1/2] spi: spidev: fix a race condition when accessing spidev->spi Date: Fri, 6 Jan 2023 11:07:18 +0100 Message-Id: <20230106100719.196243-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754267619669699171?= X-GMAIL-MSGID: =?utf-8?q?1754267619669699171?= From: Bartosz Golaszewski There's a spinlock in place that is taken in file_operations callbacks whenever we check if spidev->spi is still alive (not null). It's also taken when spidev->spi is set to NULL in remove(). This however doesn't protect the code against driver unbind event while one of the syscalls is still in progress. To that end we need a lock taken continuously as long as we may still access spidev->spi. As both the file ops and the remove callback are never called from interrupt context, we can replace the spinlock with a mutex. Signed-off-by: Bartosz Golaszewski --- v1 -> v2: - use a mutex instead of an RW semaphore (but for the record: I believe that the semaphore is the better solution here) drivers/spi/spidev.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 6313e7d0cdf8..42aaaca67265 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -68,7 +68,7 @@ static_assert(N_SPI_MINORS > 0 && N_SPI_MINORS <= 256); struct spidev_data { dev_t devt; - spinlock_t spi_lock; + struct mutex spi_lock; struct spi_device *spi; struct list_head device_entry; @@ -95,9 +95,8 @@ spidev_sync(struct spidev_data *spidev, struct spi_message *message) int status; struct spi_device *spi; - spin_lock_irq(&spidev->spi_lock); + mutex_lock(&spidev->spi_lock); spi = spidev->spi; - spin_unlock_irq(&spidev->spi_lock); if (spi == NULL) status = -ESHUTDOWN; @@ -107,6 +106,7 @@ spidev_sync(struct spidev_data *spidev, struct spi_message *message) if (status == 0) status = message->actual_length; + mutex_unlock(&spidev->spi_lock); return status; } @@ -359,12 +359,12 @@ spidev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) * we issue this ioctl. */ spidev = filp->private_data; - spin_lock_irq(&spidev->spi_lock); + mutex_lock(&spidev->spi_lock); spi = spi_dev_get(spidev->spi); - spin_unlock_irq(&spidev->spi_lock); - - if (spi == NULL) + if (spi == NULL) { + mutex_unlock(&spidev->spi_lock); return -ESHUTDOWN; + } /* use the buffer lock here for triple duty: * - prevent I/O (from us) so calling spi_setup() is safe; @@ -508,6 +508,7 @@ spidev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) mutex_unlock(&spidev->buf_lock); spi_dev_put(spi); + mutex_unlock(&spidev->spi_lock); return retval; } @@ -529,12 +530,12 @@ spidev_compat_ioc_message(struct file *filp, unsigned int cmd, * we issue this ioctl. */ spidev = filp->private_data; - spin_lock_irq(&spidev->spi_lock); + mutex_lock(&spidev->spi_lock); spi = spi_dev_get(spidev->spi); - spin_unlock_irq(&spidev->spi_lock); - - if (spi == NULL) + if (spi == NULL) { + mutex_unlock(&spidev->spi_lock); return -ESHUTDOWN; + } /* SPI_IOC_MESSAGE needs the buffer locked "normally" */ mutex_lock(&spidev->buf_lock); @@ -561,6 +562,7 @@ spidev_compat_ioc_message(struct file *filp, unsigned int cmd, done: mutex_unlock(&spidev->buf_lock); spi_dev_put(spi); + mutex_unlock(&spidev->spi_lock); return retval; } @@ -640,10 +642,10 @@ static int spidev_release(struct inode *inode, struct file *filp) spidev = filp->private_data; filp->private_data = NULL; - spin_lock_irq(&spidev->spi_lock); + mutex_lock(&spidev->spi_lock); /* ... after we unbound from the underlying device? */ dofree = (spidev->spi == NULL); - spin_unlock_irq(&spidev->spi_lock); + mutex_unlock(&spidev->spi_lock); /* last close? */ spidev->users--; @@ -776,7 +778,7 @@ static int spidev_probe(struct spi_device *spi) /* Initialize the driver data */ spidev->spi = spi; - spin_lock_init(&spidev->spi_lock); + mutex_init(&spidev->spi_lock); mutex_init(&spidev->buf_lock); INIT_LIST_HEAD(&spidev->device_entry); @@ -821,9 +823,9 @@ static void spidev_remove(struct spi_device *spi) /* prevent new opens */ mutex_lock(&device_list_lock); /* make sure ops on existing fds can abort cleanly */ - spin_lock_irq(&spidev->spi_lock); + mutex_lock(&spidev->spi_lock); spidev->spi = NULL; - spin_unlock_irq(&spidev->spi_lock); + mutex_unlock(&spidev->spi_lock); list_del(&spidev->device_entry); device_destroy(spidev_class, spidev->devt); From patchwork Fri Jan 6 10:07:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 40067 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp744480wrt; Fri, 6 Jan 2023 02:14:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXuTz0/2wnpX1AQhxGUqKzXzz/f2O9ZdNzTOar3FRwo1euLumeGHj+Fnc4+GB1wF7ftcCdn5 X-Received: by 2002:a17:907:9c08:b0:78d:f454:ba4a with SMTP id ld8-20020a1709079c0800b0078df454ba4amr33385734ejc.73.1673000042569; Fri, 06 Jan 2023 02:14:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673000042; cv=none; d=google.com; s=arc-20160816; b=KPFPBhUGkpTaHQkHBrjfburH8Mg7BV5I6b6g/v/IfMYZF3Cx4ir71Ln3rrz6/9LbVC 4G1cDDcq3Fez4Lcclba5FqskQzEidZwlN9k5C/HL/RS3xVtuebYYqH6BeoamRmA4V+5y wg0rJyAh3GpwL45b7/JN4LN82LQhX5+ev4sR8jTG1cVLDBckfTB549QKZpdXG/CHEfj6 /Ud/g6EyCNBTLwpsWZBukzZn5QDMU32Z3wy0Wt9KpM4c98oPb+FT2Qe0PYXFBX10BpkE es51AeDw++JeEhqDut1+2Wa43qp5JA9Xw0xMaBaLxiL8mB4tn9SkSnALRk7I04hRg6Oc vevw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PZWY1/S6RdMZhtZh79E6ztwnlZlP7yNb5btDBzqm71k=; b=hIaL4mvDcVN5WlkSJ1KHKqsswK1O6PF/vp3J5G+fZUjwvHqkDFdQ1f+j016/sF2zhJ z4KwXBx9+cIImIRSzp5D1cIZSvqqUs0WQtnQHGRfCo3HpqUwaC0znizFb9Kwduyuy1Km vZ25xxsYAAKtUC0NuTXwn5BnpQYwW28EFps1zZ3379tMVH02C8+CSFDWLFNDGW3875Yx v2CputAL6OR6BTtlBrnnenVtcWh8eN83eMhnxqPRckyhqaUAduAGFFJan0d5GXpNmmg9 JSoGmKp6wK4ERsx5x3Eecmzguklya3XQokcsOGggYZH6PaxXoGJATok2Qq3rTZUlwDep UghA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=MkRwuDva; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wt13-20020a170906ee8d00b007cb0cf0b18asi834270ejb.743.2023.01.06.02.13.38; Fri, 06 Jan 2023 02:14:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=MkRwuDva; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233116AbjAFKHc (ORCPT + 99 others); Fri, 6 Jan 2023 05:07:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232599AbjAFKH0 (ORCPT ); Fri, 6 Jan 2023 05:07:26 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBC5B1C11E for ; Fri, 6 Jan 2023 02:07:23 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id az7so831453wrb.5 for ; Fri, 06 Jan 2023 02:07:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PZWY1/S6RdMZhtZh79E6ztwnlZlP7yNb5btDBzqm71k=; b=MkRwuDvaRgv64sZzuV19hROgiMZ0beknf9LKQN28c33XcAq8LLf1AOHHlQ/+b91out MQweAOg/onmevNjJt+6u6iC+5vcQRrRlNshahgxThNZkTp7zOKML6/582B2ngE3Rvq8i krbH8NzNZRUjuyUqeS8hKtnKU4K777nc9d8tbgaXCYs2Iqr6PgYUC1VkD0Pe9YCR4z/D l56RgqjaeOQncpFkOW8/4k/5DXZsHswQgTW0IhUoaI/fAEzSBwwm4hzB+FqjKqxaNp4Z u7C23PFTO823LQX3VQkFWg2pDnzntiX3v3k8z3G/2C3v+g4u88cHXkET+k7FlCQ0ap4q 9Caw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PZWY1/S6RdMZhtZh79E6ztwnlZlP7yNb5btDBzqm71k=; b=W3BjLFBcAhwXYhQdR0zqCUUgjtdP5Jw0rNquF7Zb6p+R0+dYDsSXXqHNE1XBhVlMQZ 9f54qzXj/0IaTx3/C3sKVPi0BaOFHiF8aWo4Br9U4f8ZD+4Rw6TAANhVMwVF4Y/7/0jR q9MH+/s8ueItwcZ//weStXyLChIHsWv7LOPFVrVog0P+jG4FKCmsXgnoBjorDFffYcu1 zTp0iwFNncYOCAUsWOJOMg8QXz30fWgjlK2rSaQAEV2a5fZ2T+9aZRZPQ9eyJQkZuVMW k0WFFd9ntj/uk3wEInGwOi+ekNSsdafNq6tbIFtqi6UdgQnSlK+cDoQlB/bwfHzEAusC yMdA== X-Gm-Message-State: AFqh2krqdkC/qyZGZaLg5EDqmuyuoSg032/ocVnBX9sX/IQ/3vsw8I7E oJHzkyQ5Ek0x2a5dZSlHs6RnPPfNp2+lTte6 X-Received: by 2002:adf:f7d1:0:b0:273:a0d8:c9f5 with SMTP id a17-20020adff7d1000000b00273a0d8c9f5mr27666658wrq.61.1672999642540; Fri, 06 Jan 2023 02:07:22 -0800 (PST) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:86fd:399:3851:d474]) by smtp.gmail.com with ESMTPSA id f2-20020adfdb42000000b0024274a5db0asm780594wrj.2.2023.01.06.02.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 02:07:22 -0800 (PST) From: Bartosz Golaszewski To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 2/2] spi: spidev: remove debug messages that access spidev->spi without locking Date: Fri, 6 Jan 2023 11:07:19 +0100 Message-Id: <20230106100719.196243-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230106100719.196243-1-brgl@bgdev.pl> References: <20230106100719.196243-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754267692913293866?= X-GMAIL-MSGID: =?utf-8?q?1754267692913293866?= From: Bartosz Golaszewski The two debug messages in spidev_open() dereference spidev->spi without taking the lock and without checking if it's not null. This can lead to a crash. Drop the messages as they're not needed - the user-space will get informed about ENOMEM with the syscall return value. Signed-off-by: Bartosz Golaszewski --- v1 -> v2: - no changes drivers/spi/spidev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 42aaaca67265..1935ca613447 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -603,7 +603,6 @@ static int spidev_open(struct inode *inode, struct file *filp) if (!spidev->tx_buffer) { spidev->tx_buffer = kmalloc(bufsiz, GFP_KERNEL); if (!spidev->tx_buffer) { - dev_dbg(&spidev->spi->dev, "open/ENOMEM\n"); status = -ENOMEM; goto err_find_dev; } @@ -612,7 +611,6 @@ static int spidev_open(struct inode *inode, struct file *filp) if (!spidev->rx_buffer) { spidev->rx_buffer = kmalloc(bufsiz, GFP_KERNEL); if (!spidev->rx_buffer) { - dev_dbg(&spidev->spi->dev, "open/ENOMEM\n"); status = -ENOMEM; goto err_alloc_rx_buf; }