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

Staging: comedi: kcomedilib: replace deprecated simple_strtoul() with kstrtouint()

Since simple_strtoul() has been deprecated, replace it with kstrtouint().
Also, since return code checking for this new function is enforced, add a
check to ensure that the conversion has succeeded.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Chase Southwood and committed by
Greg Kroah-Hartman
e6bed035 60800abd

+2 -1
+2 -1
drivers/staging/comedi/kcomedilib/kcomedilib_main.c
··· 41 41 if (strncmp(filename, "/dev/comedi", 11) != 0) 42 42 return NULL; 43 43 44 - minor = simple_strtoul(filename + 11, NULL, 0); 44 + if (kstrtouint(filename + 11, 0, &minor)) 45 + return NULL; 45 46 46 47 if (minor >= COMEDI_NUM_BOARD_MINORS) 47 48 return NULL;