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

/drivers/staging/dgrp: Fixed warning unchecked sscanf return value

This patch solves the warning: unchecked sscanf return value from the script
checkpatch.pl for the file dgrp_sysfs.c

Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>

authored by

Andreea-Cristina Bernat and committed by
Peter P Waskiewicz Jr
62368dad 88469522

+3 -1
+3 -1
drivers/staging/dgrp/dgrp_sysfs.c
··· 65 65 struct device_attribute *attr, 66 66 const char *buf, size_t count) 67 67 { 68 - sscanf(buf, "0x%x\n", &dgrp_poll_tick); 68 + if (sscanf(buf, "0x%x\n", &dgrp_poll_tick) != 1) 69 + return -EINVAL; 70 + 69 71 return count; 70 72 } 71 73 static DEVICE_ATTR(pollrate, 0600, dgrp_class_pollrate_show,