diff options
author | Ursula Braun <ursula.braun@de.ibm.com> | 2014-05-28 10:22:31 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-30 17:35:23 -0700 |
commit | a68be015aece7b9f33f1523048e445b72ca7111d (patch) | |
tree | af8d8ad62a6b81cc570cdfed83496872e670e909 /drivers/s390/net/lcs.c | |
parent | e95051ff5a0b76e672f6d30e8bb8f93cc11c8018 (diff) |
s390/net: fix format string mismatches
cppcheck blamed some issues in drivers/s390/net/...
They are fixed here.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Reported-by: Toralf Foerster <toralf.foerster@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/lcs.c')
-rw-r--r-- | drivers/s390/net/lcs.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index 8d5d96969c39..0a7d87c372b8 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -1943,14 +1943,16 @@ static ssize_t lcs_portno_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct lcs_card *card; - int value; + int value, rc; card = dev_get_drvdata(dev); if (!card) return 0; - sscanf(buf, "%u", &value); + rc = sscanf(buf, "%d", &value); + if (rc != 1) + return -EINVAL; /* TODO: sanity checks */ card->portno = value; @@ -1997,14 +1999,17 @@ static ssize_t lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct lcs_card *card; - int value; + unsigned int value; + int rc; card = dev_get_drvdata(dev); if (!card) return 0; - sscanf(buf, "%u", &value); + rc = sscanf(buf, "%u", &value); + if (rc != 1) + return -EINVAL; /* TODO: sanity checks */ card->lancmd_timeout = value; |