From: Andreea-Cristina Bernat Date: Mon, 10 Mar 2014 12:01:13 +0000 (+0200) Subject: /drivers/staging/dgrp: Fixed warning unchecked sscanf return value X-Git-Tag: v3.15-rc1~139^2~447^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=62368dad3dee31829fddf1c31d32fe515b8da7c2;p=karo-tx-linux.git /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 Signed-off-by: Peter P Waskiewicz Jr --- diff --git a/drivers/staging/dgrp/dgrp_sysfs.c b/drivers/staging/dgrp/dgrp_sysfs.c index 9a18a2c9e73b..2f9345ff0abb 100644 --- a/drivers/staging/dgrp/dgrp_sysfs.c +++ b/drivers/staging/dgrp/dgrp_sysfs.c @@ -65,7 +65,9 @@ static ssize_t dgrp_class_pollrate_store(struct device *c, struct device_attribute *attr, const char *buf, size_t count) { - sscanf(buf, "0x%x\n", &dgrp_poll_tick); + if (sscanf(buf, "0x%x\n", &dgrp_poll_tick) != 1) + return -EINVAL; + return count; } static DEVICE_ATTR(pollrate, 0600, dgrp_class_pollrate_show,