libertas: Fix lbs_prb_rsp_limit_set()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Jun 2017 15:17:38 +0000 (18:17 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 28 Jun 2017 18:18:08 +0000 (21:18 +0300)
The kstrtoul() test was reversed so this always returned -ENOTSUPP.

Fixes: 27d7f47756f4 ("net: wireless: replace strict_strtoul() with kstrtoul()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: James Cameron <quozl@laptop.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/libertas/mesh.c

index eeeb892219aa4c50fb154207d2b8d773b085fd77..37ace5cb309d1a1b1a762c19757a0a1569a5b32b 100644 (file)
@@ -233,8 +233,9 @@ static ssize_t lbs_prb_rsp_limit_set(struct device *dev,
        memset(&mesh_access, 0, sizeof(mesh_access));
        mesh_access.data[0] = cpu_to_le32(CMD_ACT_SET);
 
-       if (!kstrtoul(buf, 10, &retry_limit))
-               return -ENOTSUPP;
+       ret = kstrtoul(buf, 10, &retry_limit);
+       if (ret)
+               return ret;
        if (retry_limit > 15)
                return -ENOTSUPP;