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 <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Mark Hounschell 2014-03-04 16:03:10 -05:00 committed by Greg Kroah-Hartman
parent c96f565e88
commit c4875ebf2e
1 changed files with 2 additions and 1 deletions

View File

@ -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);