From: Mark Hounschell Date: Tue, 4 Mar 2014 21:03:10 +0000 (-0500) Subject: staging: dgap: fix checkpatch warning on sscanf usage X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c4875ebf2e40bb99b42864487fb304f79643841e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: dgap: fix checkpatch warning on sscanf usage This patch fixes a checkpatch warning for not checking the return value of sscanf. Signed-off-by: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 6bd21e97ed8c..51f9924eac10 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -6017,7 +6017,8 @@ static ssize_t dgap_driver_pollrate_show(struct device_driver *ddp, char *buf) static ssize_t dgap_driver_pollrate_store(struct device_driver *ddp, const char *buf, size_t count) { - sscanf(buf, "%d\n", &dgap_poll_tick); + if (sscanf(buf, "%d\n", &dgap_poll_tick) != 1) + return -EINVAL; return count; } static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgap_driver_pollrate_show, dgap_driver_pollrate_store);