Skip to content
Commit 6d3ff1cc authored by Andreas Ruprecht's avatar Andreas Ruprecht Committed by Greg Kroah-Hartman
Browse files

Staging: iio/adc: strict_strtoul was used with a long type variable



The function ad7280_store_balance_timer() parses data from a char*
buffer into a long variable, but uses the the function strict_strtoul
which expects a pointer to an unsigned long variable as its third
parameter.

As Dan Carpenter mentioned, the values are capped a few lines later,
but a check if val is negative is missing.
Now this function will return -ERANGE if there is a representation of
a negative number in buf.

Additionally the checkpatch.pl considers strict_strtoul as obsolete.
I replaced its call with the suggested kstrtoul.

Signed-off-by: default avatarAndreas Ruprecht <rupran@einserver.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d83fb184
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment