1
0
Fork 0

staging: mt7621-mmc: place a check for sscanf

Placed a check for the return value of sscanf. -EINVAL is returned if
the value is anything other than expected. Reported by checkpatch.pl

Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.1
Sumit Pundir 2018-08-10 18:01:40 +05:30 committed by Greg Kroah-Hartman
parent fff12fcd60
commit b9e50d0cfd
1 changed files with 3 additions and 1 deletions

View File

@ -249,7 +249,9 @@ static ssize_t msdc_debug_proc_write(struct file *file,
cmd_buf[count] = '\0';
pr_debug("msdc Write %s\n", cmd_buf);
sscanf(cmd_buf, "%x %x %x", &cmd, &p1, &p2);
ret = sscanf(cmd_buf, "%x %x %x", &cmd, &p1, &p2);
if (ret != 3)
return -EINVAL;
if (cmd == SD_TOOL_ZONE) {
id = p1;