* [linux-stable-rc:linux-5.10.y 642/862] drivers/usb/serial/keyspan_pda.c:550:30: warning: variable 'priv' set but not used
@ 2021-01-08 14:35 kernel test robot
2021-01-08 15:01 ` Johan Hovold
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-01-08 14:35 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2910 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
head: 208f314c03c52f01c09eaff3018fd704c2f8fbe2
commit: df2754ae5f0eb7d15d541d837b8e8725d3e56817 [642/862] USB: serial: keyspan_pda: fix write-wakeup use-after-free
config: mips-randconfig-r026-20210108 (attached as .config)
compiler: mips64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=df2754ae5f0eb7d15d541d837b8e8725d3e56817
git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-5.10.y
git checkout df2754ae5f0eb7d15d541d837b8e8725d3e56817
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/usb/serial/keyspan_pda.c: In function 'keyspan_pda_write_bulk_callback':
>> drivers/usb/serial/keyspan_pda.c:550:30: warning: variable 'priv' set but not used [-Wunused-but-set-variable]
550 | struct keyspan_pda_private *priv;
| ^~~~
vim +/priv +550 drivers/usb/serial/keyspan_pda.c
^1da177e4c3f415 Linus Torvalds 2005-04-16 545
^1da177e4c3f415 Linus Torvalds 2005-04-16 546
7d12e780e003f93 David Howells 2006-10-05 547 static void keyspan_pda_write_bulk_callback(struct urb *urb)
^1da177e4c3f415 Linus Torvalds 2005-04-16 548 {
cdc977922891799 Ming Lei 2008-02-24 549 struct usb_serial_port *port = urb->context;
^1da177e4c3f415 Linus Torvalds 2005-04-16 @550 struct keyspan_pda_private *priv;
^1da177e4c3f415 Linus Torvalds 2005-04-16 551
da280e348866004 Johan Hovold 2011-11-06 552 set_bit(0, &port->write_urbs_free);
^1da177e4c3f415 Linus Torvalds 2005-04-16 553 priv = usb_get_serial_port_data(port);
^1da177e4c3f415 Linus Torvalds 2005-04-16 554
^1da177e4c3f415 Linus Torvalds 2005-04-16 555 /* queue up a wakeup at scheduler time */
df2754ae5f0eb7d Johan Hovold 2020-10-25 556 usb_serial_port_softint(port);
^1da177e4c3f415 Linus Torvalds 2005-04-16 557 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 558
:::::: The code at line 550 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 20812 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [linux-stable-rc:linux-5.10.y 642/862] drivers/usb/serial/keyspan_pda.c:550:30: warning: variable 'priv' set but not used
2021-01-08 14:35 [linux-stable-rc:linux-5.10.y 642/862] drivers/usb/serial/keyspan_pda.c:550:30: warning: variable 'priv' set but not used kernel test robot
@ 2021-01-08 15:01 ` Johan Hovold
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2021-01-08 15:01 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3203 bytes --]
On Fri, Jan 08, 2021 at 10:35:10PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
> head: 208f314c03c52f01c09eaff3018fd704c2f8fbe2
> commit: df2754ae5f0eb7d15d541d837b8e8725d3e56817 [642/862] USB: serial: keyspan_pda: fix write-wakeup use-after-free
> config: mips-randconfig-r026-20210108 (attached as .config)
> compiler: mips64-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=df2754ae5f0eb7d15d541d837b8e8725d3e56817
> git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> git fetch --no-tags linux-stable-rc linux-5.10.y
> git checkout df2754ae5f0eb7d15d541d837b8e8725d3e56817
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> drivers/usb/serial/keyspan_pda.c: In function 'keyspan_pda_write_bulk_callback':
> >> drivers/usb/serial/keyspan_pda.c:550:30: warning: variable 'priv' set but not used [-Wunused-but-set-variable]
> 550 | struct keyspan_pda_private *priv;
> | ^~~~
Indeed, priv should have been removed by this patch, but it was
mistakingly removed by a follow-on patch in mainline instead.
Greg, I only see this warning with W=1, but here's a patch to silence
the build bots for the stable trees in case you want it.
Johan
>From 62218024401fac7dd7c7a6e74b566164d515d922 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@kernel.org>
Date: Fri, 8 Jan 2021 15:55:28 +0100
Subject: [PATCH] USB: serial: keyspan_pda: remove unused variable
Remove an unused variable which was mistakingly left by commit
37faf5061541 ("USB: serial: keyspan_pda: fix write-wakeup
use-after-free") and only removed by a later change.
This is needed to suppress a W=1 warning about the unused variable in
the stable trees that the build bots triggers.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/usb/serial/keyspan_pda.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index 39ed3ad32365..aec32bf06e01 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -555,10 +555,8 @@ static int keyspan_pda_write(struct tty_struct *tty,
static void keyspan_pda_write_bulk_callback(struct urb *urb)
{
struct usb_serial_port *port = urb->context;
- struct keyspan_pda_private *priv;
set_bit(0, &port->write_urbs_free);
- priv = usb_get_serial_port_data(port);
/* queue up a wakeup at scheduler time */
usb_serial_port_softint(port);
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-08 15:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 14:35 [linux-stable-rc:linux-5.10.y 642/862] drivers/usb/serial/keyspan_pda.c:550:30: warning: variable 'priv' set but not used kernel test robot
2021-01-08 15:01 ` Johan Hovold
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.