Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 926f0b2e authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by John W. Linville
Browse files

iwlwifi: fix strict_strtoul error checking



This patch fixes handling of strcit_strtoul return value
"0 == sucess".

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6e21f2c1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3726,7 +3726,7 @@ static ssize_t store_flags(struct device *d,
	unsigned long val;
	u32 flags;
	int ret = strict_strtoul(buf, 0, &val);
	if (!ret)
	if (ret)
		return ret;
	flags = (u32)val;

@@ -3765,7 +3765,7 @@ static ssize_t store_filter_flags(struct device *d,
	unsigned long val;
	u32 filter_flags;
	int ret = strict_strtoul(buf, 0, &val);
	if (!ret)
	if (ret)
		return ret;
	filter_flags = (u32)val;

@@ -3905,7 +3905,7 @@ static ssize_t store_power_level(struct device *d,
	}

	ret = strict_strtoul(buf, 10, &mode);
	if (!ret)
	if (ret)
		goto out;

	ret = iwl_power_set_user_mode(priv, mode);