From patchwork Thu Sep 26 09:12:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11161995 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BCD8913B1 for ; Thu, 26 Sep 2019 09:12:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B6B2222C5 for ; Thu, 26 Sep 2019 09:12:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569489171; bh=9T2cneHQ7XqSAIUOQrPR0ScATXba/YuqsElPghl9baI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UDBzIyxNFhH91zc9Rjk/oOwbKe+P9q0yLkez2qfRKfrkJ2cVvu8Kh+EpKfawP0Oab Cc1dvby5H6X04qwTxlggC4IybwFHvcHhjxVbPlYTR2k8UNQ0ScoNalm6VY7cz7j8KT puMEx6XKJIVt5WOK/5eArXzGES7KHL36aH2Mmv0k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729760AbfIZJMs (ORCPT ); Thu, 26 Sep 2019 05:12:48 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:42876 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbfIZJMr (ORCPT ); Thu, 26 Sep 2019 05:12:47 -0400 Received: by mail-lf1-f67.google.com with SMTP id c195so1110637lfg.9; Thu, 26 Sep 2019 02:12:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bKDYWL5jP7ajoKT3dPjrbKASExuHF8+ZZfOI4omjdpc=; b=XPJR8h+FUoQQyVurHol5k/Y7gcXdi2mnwR4bdDWIHPvOChOULPSOM7zBDFnE8sVjY5 EFjX3axYcLd5W4eCWS5t2FfBW3RTHlhj34Hw2u9360SovmAcPMcr/TFBZY7n4mUJloy5 mH82PCqNBK7Gaae5miGac+aiuZWz55Adx9E4j4Yfkt0NffGgXM2x/mELJkjUp0YxkfWO urveh8sFCCiFr/EQiPn/7NyQ9attjLdMSL+NIlbepJRdt9p0wCzWnWP+blpOjn6LMACg Bl6qsgRfbQOxA4dc/LXkfVodHjCfC85ryWNNALdv/AjhTYWpy0YvCYtMl03yhNB/Yva7 MfkA== X-Gm-Message-State: APjAAAWJWULRABLTjNaDU0kDd5SMByB4Gi6T+Mg5w+wCKK7DfF/gIgBR FZPwwcZ0BZ5FeoDQx/5YAZAjxmz3 X-Google-Smtp-Source: APXvYqxLBm2G3bPS02nHgMMOQ+MjjSjzib9tQmAzzXHvuE7ivw25+HwU7ohsS3npSu1FDBtQ4NdXaA== X-Received: by 2002:ac2:48af:: with SMTP id u15mr1550965lfg.75.1569489164262; Thu, 26 Sep 2019 02:12:44 -0700 (PDT) Received: from xi.terra (c-51f1e055.07-184-6d6c6d4.bbcust.telenor.se. [85.224.241.81]) by smtp.gmail.com with ESMTPSA id k13sm369346ljc.96.2019.09.26.02.12.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Sep 2019 02:12:43 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.92.2) (envelope-from ) id 1iDPpR-0006QS-PB; Thu, 26 Sep 2019 11:12:49 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Johan Hovold , stable Subject: [PATCH 1/4] USB: usblcd: fix I/O after disconnect Date: Thu, 26 Sep 2019 11:12:20 +0200 Message-Id: <20190926091228.24634-2-johan@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190926091228.24634-1-johan@kernel.org> References: <20190926091228.24634-1-johan@kernel.org> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Make sure to stop all I/O on disconnect by adding a disconnected flag which is used to prevent new I/O from being started and by stopping all ongoing I/O before returning. This also fixes a potential use-after-free on driver unbind in case the driver data is freed before the completion handler has run. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable # 7bbe990c989e Signed-off-by: Johan Hovold --- drivers/usb/misc/usblcd.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index 9ba4a4e68d91..aa982d3ca36b 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -57,6 +58,8 @@ struct usb_lcd { using up all RAM */ struct usb_anchor submitted; /* URBs to wait for before suspend */ + struct rw_semaphore io_rwsem; + unsigned long disconnected:1; }; #define to_lcd_dev(d) container_of(d, struct usb_lcd, kref) @@ -142,6 +145,13 @@ static ssize_t lcd_read(struct file *file, char __user * buffer, dev = file->private_data; + down_read(&dev->io_rwsem); + + if (dev->disconnected) { + retval = -ENODEV; + goto out_up_io; + } + /* do a blocking bulk read to get data from the device */ retval = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, @@ -158,6 +168,9 @@ static ssize_t lcd_read(struct file *file, char __user * buffer, retval = bytes_read; } +out_up_io: + up_read(&dev->io_rwsem); + return retval; } @@ -237,11 +250,18 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, if (r < 0) return -EINTR; + down_read(&dev->io_rwsem); + + if (dev->disconnected) { + retval = -ENODEV; + goto err_up_io; + } + /* create a urb, and a buffer for it, and copy the data to the urb */ urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) { retval = -ENOMEM; - goto err_no_buf; + goto err_up_io; } buf = usb_alloc_coherent(dev->udev, count, GFP_KERNEL, @@ -278,6 +298,7 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, the USB core will eventually free it entirely */ usb_free_urb(urb); + up_read(&dev->io_rwsem); exit: return count; error_unanchor: @@ -285,7 +306,8 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, error: usb_free_coherent(dev->udev, count, buf, urb->transfer_dma); usb_free_urb(urb); -err_no_buf: +err_up_io: + up_read(&dev->io_rwsem); up(&dev->limit_sem); return retval; } @@ -325,6 +347,7 @@ static int lcd_probe(struct usb_interface *interface, kref_init(&dev->kref); sema_init(&dev->limit_sem, USB_LCD_CONCURRENT_WRITES); + init_rwsem(&dev->io_rwsem); init_usb_anchor(&dev->submitted); dev->udev = usb_get_dev(interface_to_usbdev(interface)); @@ -422,6 +445,12 @@ static void lcd_disconnect(struct usb_interface *interface) /* give back our minor */ usb_deregister_dev(interface, &lcd_class); + down_write(&dev->io_rwsem); + dev->disconnected = 1; + up_write(&dev->io_rwsem); + + usb_kill_anchored_urbs(&dev->submitted); + /* decrement our usage count */ kref_put(&dev->kref, lcd_delete); From patchwork Thu Sep 26 09:12:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11161991 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5CD02912 for ; Thu, 26 Sep 2019 09:12:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39FDC222C0 for ; Thu, 26 Sep 2019 09:12:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569489171; bh=3qyApSFj4rcXV3bqrE1BDXVcdGMJW0R7O3zKWdjA7dk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BuWFfnVHUr/iRjFU+cPqr+fIhyc6dHL3g4fbq2byV4WVjZomgqBj7wB1qdqp1fuEv 6uHC5v/DlKHZZMvkDLbuLUOk6TtbVq/qaWD88Tj6puhQTasLC4UwSOfUbu3NfndCZP Kez26mZF0ha5PLTx1f8zwTvjrWmvsXfUhQJZTQ+w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729881AbfIZJMs (ORCPT ); Thu, 26 Sep 2019 05:12:48 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:44060 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbfIZJMr (ORCPT ); Thu, 26 Sep 2019 05:12:47 -0400 Received: by mail-lf1-f67.google.com with SMTP id q11so1102455lfc.11 for ; Thu, 26 Sep 2019 02:12:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nSE68eO8cJa8cg6l73GI+YOtkPnzSUMRPGBx5GZoj60=; b=SiXYJbfi+IlY7Fowdh8ygbIdYFvWMt3A9wIc2t+l5RYy0y/uwdKQo8jYet+h1ppTw1 1yNSRbPP5diPWtYZ9daVUSQ5KjPI/U3rYB4LuipK2QPUS4aKjqyT+0jzbn0HdAhYU+v+ rbQPFvjBqJyMPKW6kko+1HbrVzZem7O6Fu9ellPn7mn11DXHLpKSi6aCN2DpG7uz2XZt 2QTUb6VI4SPLBIVhLaZHAbNNOCtcGwYcyTl9HGQ+rxNJYKPvnvM9wJEITimK5t3f/2CY 31a9b4OmLlS9YYpMyKCSMeBUNbuQ+RK2G0tXsN3R1altlOhT0yVVizBZvoWkUh9YrKI2 AwKw== X-Gm-Message-State: APjAAAUx8vZUK3cBxsabscKacKZlpQrNKo43whLzs4R7IlkOaXfrUA7F 0erafc80goiIEM3rU29wQ6g= X-Google-Smtp-Source: APXvYqzysxeR+pQPgfpZN7EZKz/1TGHZlvoLW9zO3y3sJFE+Id8TKZPc2fV2Lw8TypRuoaYmC7rITw== X-Received: by 2002:a19:f707:: with SMTP id z7mr1579702lfe.142.1569489164676; Thu, 26 Sep 2019 02:12:44 -0700 (PDT) Received: from xi.terra (c-51f1e055.07-184-6d6c6d4.bbcust.telenor.se. [85.224.241.81]) by smtp.gmail.com with ESMTPSA id o13sm371024lji.31.2019.09.26.02.12.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Sep 2019 02:12:43 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.92.2) (envelope-from ) id 1iDPpR-0006QW-RZ; Thu, 26 Sep 2019 11:12:49 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Johan Hovold Subject: [PATCH 2/4] USB: usblcd: drop redundant disconnect mutex Date: Thu, 26 Sep 2019 11:12:21 +0200 Message-Id: <20190926091228.24634-3-johan@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190926091228.24634-1-johan@kernel.org> References: <20190926091228.24634-1-johan@kernel.org> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Drop the redundant disconnect mutex which was introduced after the open-disconnect race had been addressed generally in USB core by commit d4ead16f50f9 ("USB: prevent char device open/deregister race"). Specifically, the rw-semaphore in core guarantees that all calls to open() will have completed and that no new calls to open() will occur after usb_deregister_dev() returns. Hence there is no need use the driver data as an inverted disconnected flag. Signed-off-by: Johan Hovold --- drivers/usb/misc/usblcd.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index aa982d3ca36b..b898650a5570 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -37,9 +37,6 @@ static const struct usb_device_id id_table[] = { }; MODULE_DEVICE_TABLE(usb, id_table); -static DEFINE_MUTEX(open_disc_mutex); - - struct usb_lcd { struct usb_device *udev; /* init: probe_lcd */ struct usb_interface *interface; /* the interface for @@ -95,17 +92,10 @@ static int lcd_open(struct inode *inode, struct file *file) return -ENODEV; } - mutex_lock(&open_disc_mutex); dev = usb_get_intfdata(interface); - if (!dev) { - mutex_unlock(&open_disc_mutex); - mutex_unlock(&lcd_mutex); - return -ENODEV; - } /* increment our usage count for the device */ kref_get(&dev->kref); - mutex_unlock(&open_disc_mutex); /* grab a power reference */ r = usb_autopm_get_interface(interface); @@ -388,7 +378,6 @@ static int lcd_probe(struct usb_interface *interface, /* something prevented us from registering this driver */ dev_err(&interface->dev, "Not able to get a minor for this device.\n"); - usb_set_intfdata(interface, NULL); goto error; } @@ -434,14 +423,9 @@ static int lcd_resume(struct usb_interface *intf) static void lcd_disconnect(struct usb_interface *interface) { - struct usb_lcd *dev; + struct usb_lcd *dev = usb_get_intfdata(interface); int minor = interface->minor; - mutex_lock(&open_disc_mutex); - dev = usb_get_intfdata(interface); - usb_set_intfdata(interface, NULL); - mutex_unlock(&open_disc_mutex); - /* give back our minor */ usb_deregister_dev(interface, &lcd_class); From patchwork Thu Sep 26 09:12:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11161989 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF3F213B1 for ; Thu, 26 Sep 2019 09:12:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD65C222C5 for ; Thu, 26 Sep 2019 09:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569489167; bh=D0IHdoYL+cdWFefW3ed7cXAIOAxO7+Hp43rw32M1Kyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ikNI0huWreJmw4OWtMY3rpm05oWEGpObaZqJICsys/RnTHGgzZXpJTo6IhwxOmSxP wOGpF3q5U7Xy3dsGj1EO+8UXyuV7iY3tB6jsM2A9iUn6/T6jetJqDKRRxgqHBNjBVw W+iWqHJELR0dzcKwJTez53fECJYdP0pLd3ybcWoU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727670AbfIZJMr (ORCPT ); Thu, 26 Sep 2019 05:12:47 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:38338 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbfIZJMr (ORCPT ); Thu, 26 Sep 2019 05:12:47 -0400 Received: by mail-lf1-f67.google.com with SMTP id u28so1125452lfc.5 for ; Thu, 26 Sep 2019 02:12:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E6Ii7hCmgGJll6q9WG6b8f58XKzO8877IKSX+QpN4qo=; b=YI3wutf/ElDRx7XsXYi1NP8BhzFETZjFGBLDIQLm38+BbPY26+I/xvVl4Kf2KG0wc5 dq6wB8l0tMVH98FJU/oJr7+mCBvmXb5LQIVMepDoMnA9QrnK2bLP/nBGIDyN7qFpvsQg lFjWaHbHf+WGCvSjHMQJbZDIY5XVTKbkv6xSZhlxvRqRDfj7+9iHnWXNtOn57PwF394Y 7S8DE69/l43fW0jJx64IIw252+c4m/1cSuo1+i1fMYTXlXOomK9o1iXDmOMewKrhyrpa VrWZVfXnLNSK0wVbyrqrDFIhAEc0l1c35hiUV39zWa98hNSLPSTqMcBl/NT6LS8vLoIC QnJg== X-Gm-Message-State: APjAAAVLfwckmUe06azdqhK1JNi2nVXvC02xn+5cIRxJ82LOQhfvGFq/ 10PoTcEemdZWOoCuDus720c= X-Google-Smtp-Source: APXvYqxIDREq4E80Ti66gvr0+gA6T790Z2yvXkLHsAgcATwR+2W94XAqfOo6dZrfVRsE4UoLsCB7Xw== X-Received: by 2002:a19:6001:: with SMTP id u1mr1529141lfb.50.1569489165002; Thu, 26 Sep 2019 02:12:45 -0700 (PDT) Received: from xi.terra (c-51f1e055.07-184-6d6c6d4.bbcust.telenor.se. [85.224.241.81]) by smtp.gmail.com with ESMTPSA id r22sm377634ljr.43.2019.09.26.02.12.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Sep 2019 02:12:43 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.92.2) (envelope-from ) id 1iDPpR-0006Qb-U9; Thu, 26 Sep 2019 11:12:49 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Johan Hovold Subject: [PATCH 3/4] USB: usblcd: drop redundant lcd mutex Date: Thu, 26 Sep 2019 11:12:22 +0200 Message-Id: <20190926091228.24634-4-johan@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190926091228.24634-1-johan@kernel.org> References: <20190926091228.24634-1-johan@kernel.org> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Drop the redundant lcd mutex introduced by commit 925ce689bb31 ("USB: autoconvert trivial BKL users to private mutex") which replaced an earlier BKL use. The lock serialised calls to open() against other open() and a custom ioctl() returning the bcdDevice (sic!), but neither is needed. Signed-off-by: Johan Hovold --- drivers/usb/misc/usblcd.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index b898650a5570..732eb1f81368 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -30,7 +30,6 @@ #define IOCTL_GET_DRV_VERSION 2 -static DEFINE_MUTEX(lcd_mutex); static const struct usb_device_id id_table[] = { { .idVendor = 0x10D2, .match_flags = USB_DEVICE_ID_MATCH_VENDOR, }, { }, @@ -81,12 +80,10 @@ static int lcd_open(struct inode *inode, struct file *file) struct usb_interface *interface; int subminor, r; - mutex_lock(&lcd_mutex); subminor = iminor(inode); interface = usb_find_interface(&lcd_driver, subminor); if (!interface) { - mutex_unlock(&lcd_mutex); printk(KERN_ERR "USBLCD: %s - error, can't find device for minor %d\n", __func__, subminor); return -ENODEV; @@ -101,13 +98,11 @@ static int lcd_open(struct inode *inode, struct file *file) r = usb_autopm_get_interface(interface); if (r < 0) { kref_put(&dev->kref, lcd_delete); - mutex_unlock(&lcd_mutex); return r; } /* save our object in the file's private structure */ file->private_data = dev; - mutex_unlock(&lcd_mutex); return 0; } @@ -176,14 +171,12 @@ static long lcd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) switch (cmd) { case IOCTL_GET_HARD_VERSION: - mutex_lock(&lcd_mutex); bcdDevice = le16_to_cpu((dev->udev)->descriptor.bcdDevice); sprintf(buf, "%1d%1d.%1d%1d", (bcdDevice & 0xF000)>>12, (bcdDevice & 0xF00)>>8, (bcdDevice & 0xF0)>>4, (bcdDevice & 0xF)); - mutex_unlock(&lcd_mutex); if (copy_to_user((void __user *)arg, buf, strlen(buf)) != 0) return -EFAULT; break; From patchwork Thu Sep 26 09:12:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11161993 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91DF917D4 for ; Thu, 26 Sep 2019 09:12:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 677A7222C5 for ; Thu, 26 Sep 2019 09:12:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569489171; bh=7XaC36XaNEJBL3Gg6eiTam+fMR8QP4iRWR1k+1054ak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=FIKOnEivR0zBCKrbrgO4ycXTcnxELZZbXFk2LwqgB5T7IorFCI6sAtF2JCLuDtxpy g+i1CHSqqtq1u7jAAJeAXyXN7/7LBApIdCEIc9m7e5yNrtIoU2tvFb76IeBq53bd1R qyGKsyzakqprOqiKJYxNypvjZoSC4FEJxRudnO60= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730183AbfIZJMs (ORCPT ); Thu, 26 Sep 2019 05:12:48 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:34158 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbfIZJMs (ORCPT ); Thu, 26 Sep 2019 05:12:48 -0400 Received: by mail-lj1-f195.google.com with SMTP id j19so1381425lja.1 for ; Thu, 26 Sep 2019 02:12:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W6g3+KXN9nBLb0Uwpf/8bB5Xk3DTcHgFK/ix1KLsES8=; b=cMWIUG9fPcDIv0Q0dNfnDkPnzOpv62Iuuo/SK++uGeP0e1MpuhSahTArR5QZMd9gt0 1ngDoK1cE+H1ugd0flgrOhMNDR5EhIMCeQI7IBiXXf09s/a/3s9zQN24kvwWPhv2RRo/ ZJmwLtlHgF+j9nvxr/uR4jjl9HX517rmAcKKRibq0+rXSrvIS5EcAvMhLVxfNHrNjsf6 +GWambXRiddEUC0IGXB7J+ugkBuX/fWteWmCgU5ONXBDS5Dg2hTF1Dcu1vvCqjpmtF8Y 4xBP9MymVzbr8nHFieoLyiBN0tOkXP1WIyQFpGPWTQZ3yHEXZuTuPaJ9/uy4Q130ZTHB Trsg== X-Gm-Message-State: APjAAAViIt3OOgvVs9tOsS4Q4oJFxdhZAGXWUjtCJv4jRal2FVsATpcS k4ew4EzOfm0pRFI3vPMtjDw= X-Google-Smtp-Source: APXvYqw5dMZVsW8yNFIQFj+NnGn3cFsfJHwP4p2b86XFTNdgGD0MCXPA67FFKhgdzdCudWbf9o6RMg== X-Received: by 2002:a2e:90d9:: with SMTP id o25mr1764802ljg.94.1569489166480; Thu, 26 Sep 2019 02:12:46 -0700 (PDT) Received: from xi.terra (c-51f1e055.07-184-6d6c6d4.bbcust.telenor.se. [85.224.241.81]) by smtp.gmail.com with ESMTPSA id r6sm405549lfn.29.2019.09.26.02.12.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Sep 2019 02:12:45 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.92.2) (envelope-from ) id 1iDPpS-0006Qg-0o; Thu, 26 Sep 2019 11:12:50 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Johan Hovold Subject: [PATCH 4/4] USB: usblcd: use pr_err() Date: Thu, 26 Sep 2019 11:12:23 +0200 Message-Id: <20190926091228.24634-5-johan@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190926091228.24634-1-johan@kernel.org> References: <20190926091228.24634-1-johan@kernel.org> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Replace the one remaining printk with pr_err(). Signed-off-by: Johan Hovold --- drivers/usb/misc/usblcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index 732eb1f81368..61e9e987fe4a 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -84,7 +84,7 @@ static int lcd_open(struct inode *inode, struct file *file) interface = usb_find_interface(&lcd_driver, subminor); if (!interface) { - printk(KERN_ERR "USBLCD: %s - error, can't find device for minor %d\n", + pr_err("USBLCD: %s - error, can't find device for minor %d\n", __func__, subminor); return -ENODEV; }