mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 19:07:52 +00:00
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>
This commit is contained in:
parent
07467e509b
commit
c7f268df3f
1 changed files with 1 additions and 1 deletions
|
@ -663,7 +663,7 @@ static int line6_probe(struct usb_interface *interface,
|
||||||
case LINE6_DEVID_POCKETPOD:
|
case LINE6_DEVID_POCKETPOD:
|
||||||
switch (interface_number) {
|
switch (interface_number) {
|
||||||
case 0:
|
case 0:
|
||||||
return 0; /* this interface has no endpoints */
|
return -ENODEV; /* this interface has no endpoints */
|
||||||
case 1:
|
case 1:
|
||||||
alternate = 0;
|
alternate = 0;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue