Skip to content

Commit

Permalink
staging: line6: do not return 0 from probe if no initialization done
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
khoroshilov authored and gregkh committed Jun 20, 2014
1 parent 07467e5 commit c7f268d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/line6/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c7f268d

Please sign in to comment.