Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexey Khoroshilov and committed by
Greg Kroah-Hartman
c7f268df 07467e50

+1 -1
+1 -1
drivers/staging/line6/driver.c
··· 663 663 case LINE6_DEVID_POCKETPOD: 664 664 switch (interface_number) { 665 665 case 0: 666 - return 0; /* this interface has no endpoints */ 666 + return -ENODEV; /* this interface has no endpoints */ 667 667 case 1: 668 668 alternate = 0; 669 669 break;