diff options
author | Alexey Khoroshilov | 2014-06-10 22:22:50 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2014-06-20 02:12:01 +0200 |
commit | c7f268df3f4e80513271aea8e91f3fd0701aae1b (patch) | |
tree | 32386baf2f96e5f3fb9f1fa5554b12433fde6406 /drivers/staging/line6/driver.c | |
parent | Staging: dgnc: fixed brace coding style issue in dgnc_driver.c (diff) | |
download | kernel-qcow2-linux-c7f268df3f4e80513271aea8e91f3fd0701aae1b.tar.gz kernel-qcow2-linux-c7f268df3f4e80513271aea8e91f3fd0701aae1b.tar.xz kernel-qcow2-linux-c7f268df3f4e80513271aea8e91f3fd0701aae1b.zip |
staging: line6: do not return 0 from probe if no initialization done
There is a strange "return 0" in line6_probe() before any initialization of
the module is done. It can lead to NULL pointer dereference in other functions.
The patch proposes to return -ENODEV in this case.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/line6/driver.c')
-rw-r--r-- | drivers/staging/line6/driver.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c index ef511c76a6e3..503b2d763595 100644 --- a/drivers/staging/line6/driver.c +++ b/drivers/staging/line6/driver.c @@ -663,7 +663,7 @@ static int line6_probe(struct usb_interface *interface, case LINE6_DEVID_POCKETPOD: switch (interface_number) { case 0: - return 0; /* this interface has no endpoints */ + return -ENODEV; /* this interface has no endpoints */ case 1: alternate = 0; break; |