summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-04-08 00:44:03 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-08 13:00:44 +0200
commitba508685d90fa361bb2f7d1e3cb86892a7b94ec2 (patch)
treed770e560bdba37adcf4a4ad972ce8fc568e2468b /drivers/staging
parent0e490657c7214cce33fbca3d88227298c5c968ae (diff)
staging: wilc1000: fix incorrect strncasecmp length
The strncasecmp of buff against the literal string RSSI is using variable length which is zero. This should be instead using the variable size instead. Also remove the redundant variable length. Detected by PVS-Studio, warning: V575 Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/wilc1000/linux_wlan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index bdf11c9f44a8..d6d803416be2 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1074,7 +1074,7 @@ static int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
{
u8 *buff = NULL;
s8 rssi;
- u32 size = 0, length = 0;
+ u32 size = 0;
struct wilc_vif *vif;
s32 ret = 0;
struct wilc *wilc;
@@ -1098,7 +1098,7 @@ static int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
if (IS_ERR(buff))
return PTR_ERR(buff);
- if (strncasecmp(buff, "RSSI", length) == 0) {
+ if (strncasecmp(buff, "RSSI", size) == 0) {
ret = wilc_get_rssi(vif, &rssi);
netdev_info(ndev, "RSSI :%d\n", rssi);