Skip to content

Commit c6ebb5b

Browse files
Dan Carpenterjmberg-intel
authored andcommitted
wifi: iwlwifi: Fix some error codes
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: 2a80841 ("iwlwifi: acpi: support reading and storing WRDS revision 1 and 2") Signed-off-by: Dan Carpenter <[email protected]> Link: https://msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 3012477 commit c6ebb5b

File tree

1 file changed

+6
-6
lines changed
  • drivers/net/wireless/intel/iwlwifi/fw

1 file changed

+6
-6
lines changed

drivers/net/wireless/intel/iwlwifi/fw/acpi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ int iwl_sar_get_wrds_table(struct iwl_fw_runtime *fwrt)
618618
&tbl_rev);
619619
if (!IS_ERR(wifi_pkg)) {
620620
if (tbl_rev != 2) {
621-
ret = PTR_ERR(wifi_pkg);
621+
ret = -EINVAL;
622622
goto out_free;
623623
}
624624

@@ -634,7 +634,7 @@ int iwl_sar_get_wrds_table(struct iwl_fw_runtime *fwrt)
634634
&tbl_rev);
635635
if (!IS_ERR(wifi_pkg)) {
636636
if (tbl_rev != 1) {
637-
ret = PTR_ERR(wifi_pkg);
637+
ret = -EINVAL;
638638
goto out_free;
639639
}
640640

@@ -650,7 +650,7 @@ int iwl_sar_get_wrds_table(struct iwl_fw_runtime *fwrt)
650650
&tbl_rev);
651651
if (!IS_ERR(wifi_pkg)) {
652652
if (tbl_rev != 0) {
653-
ret = PTR_ERR(wifi_pkg);
653+
ret = -EINVAL;
654654
goto out_free;
655655
}
656656

@@ -707,7 +707,7 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)
707707
&tbl_rev);
708708
if (!IS_ERR(wifi_pkg)) {
709709
if (tbl_rev != 2) {
710-
ret = PTR_ERR(wifi_pkg);
710+
ret = -EINVAL;
711711
goto out_free;
712712
}
713713

@@ -723,7 +723,7 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)
723723
&tbl_rev);
724724
if (!IS_ERR(wifi_pkg)) {
725725
if (tbl_rev != 1) {
726-
ret = PTR_ERR(wifi_pkg);
726+
ret = -EINVAL;
727727
goto out_free;
728728
}
729729

@@ -739,7 +739,7 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)
739739
&tbl_rev);
740740
if (!IS_ERR(wifi_pkg)) {
741741
if (tbl_rev != 0) {
742-
ret = PTR_ERR(wifi_pkg);
742+
ret = -EINVAL;
743743
goto out_free;
744744
}
745745

0 commit comments

Comments
 (0)