wifi: iwlwifi: Fix some error codes

[ Upstream commit c6ebb5b67641994de8bc486b33457fe0b681d6fe ]

This saves the error as PTR_ERR(wifi_pkg).  The problem is that
"wifi_pkg" is a valid pointer, not an error pointer.  Set the error code
to -EINVAL instead.

Fixes: 2a8084147b ("iwlwifi: acpi: support reading and storing WRDS revision 1 and 2")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://msgid.link/9620bb77-2d7c-4d76-b255-ad824ebf8e35@moroto.mountain
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Dan Carpenter
2024-02-08 13:17:06 +03:00
committed by Greg Kroah-Hartman
parent e5ed6c9225
commit 72d4600a6e

View File

@@ -576,7 +576,7 @@ int iwl_sar_get_wrds_table(struct iwl_fw_runtime *fwrt)
&tbl_rev); &tbl_rev);
if (!IS_ERR(wifi_pkg)) { if (!IS_ERR(wifi_pkg)) {
if (tbl_rev != 2) { if (tbl_rev != 2) {
ret = PTR_ERR(wifi_pkg); ret = -EINVAL;
goto out_free; goto out_free;
} }
@@ -592,7 +592,7 @@ int iwl_sar_get_wrds_table(struct iwl_fw_runtime *fwrt)
&tbl_rev); &tbl_rev);
if (!IS_ERR(wifi_pkg)) { if (!IS_ERR(wifi_pkg)) {
if (tbl_rev != 1) { if (tbl_rev != 1) {
ret = PTR_ERR(wifi_pkg); ret = -EINVAL;
goto out_free; goto out_free;
} }
@@ -608,7 +608,7 @@ int iwl_sar_get_wrds_table(struct iwl_fw_runtime *fwrt)
&tbl_rev); &tbl_rev);
if (!IS_ERR(wifi_pkg)) { if (!IS_ERR(wifi_pkg)) {
if (tbl_rev != 0) { if (tbl_rev != 0) {
ret = PTR_ERR(wifi_pkg); ret = -EINVAL;
goto out_free; goto out_free;
} }
@@ -665,7 +665,7 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)
&tbl_rev); &tbl_rev);
if (!IS_ERR(wifi_pkg)) { if (!IS_ERR(wifi_pkg)) {
if (tbl_rev != 2) { if (tbl_rev != 2) {
ret = PTR_ERR(wifi_pkg); ret = -EINVAL;
goto out_free; goto out_free;
} }
@@ -681,7 +681,7 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)
&tbl_rev); &tbl_rev);
if (!IS_ERR(wifi_pkg)) { if (!IS_ERR(wifi_pkg)) {
if (tbl_rev != 1) { if (tbl_rev != 1) {
ret = PTR_ERR(wifi_pkg); ret = -EINVAL;
goto out_free; goto out_free;
} }
@@ -697,7 +697,7 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)
&tbl_rev); &tbl_rev);
if (!IS_ERR(wifi_pkg)) { if (!IS_ERR(wifi_pkg)) {
if (tbl_rev != 0) { if (tbl_rev != 0) {
ret = PTR_ERR(wifi_pkg); ret = -EINVAL;
goto out_free; goto out_free;
} }