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-Url: https://git.stricted.de/?a=commitdiff_plain;h=62368dad3dee31829fddf1c31d32fe515b8da7c2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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,