diff mbox

libertas: Fix lbs_prb_rsp_limit_set()

Message ID 20170623151738.qxncismrvd4yzzfr@mwanda (mailing list archive)
State Accepted
Commit 69551f5f370cc20342fab17ca54716b6ec7e332d
Delegated to: Kalle Valo
Headers show

Commit Message

Dan Carpenter June 23, 2017, 3:17 p.m. UTC
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>

Comments

James Cameron June 23, 2017, 8:22 p.m. UTC | #1
On Fri, Jun 23, 2017 at 06:17:38PM +0300, Dan Carpenter wrote:
> 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>
Kalle Valo June 28, 2017, 6:18 p.m. UTC | #2
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> 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>
> 
> diff --git a/drivers/net/wireless/marvell/libertas/mesh.c b/drivers/net/wireless/marvell/libertas/mesh.c
> index eeeb892219aa..37ace5cb309d 100644
> --- a/drivers/net/wireless/marvell/libertas/mesh.c
> +++ b/drivers/net/wireless/marvell/libertas/mesh.c
> @@ -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;

Patch applied to wireless-drivers-next.git, thanks.

69551f5f370c libertas: Fix lbs_prb_rsp_limit_set()
diff mbox

Patch

diff --git a/drivers/net/wireless/marvell/libertas/mesh.c b/drivers/net/wireless/marvell/libertas/mesh.c
index eeeb892219aa..37ace5cb309d 100644
--- a/drivers/net/wireless/marvell/libertas/mesh.c
+++ b/drivers/net/wireless/marvell/libertas/mesh.c
@@ -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;