File tree 1 file changed +8
-5
lines changed
drivers/net/wireless/intel/iwlwifi/fw
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -867,22 +867,25 @@ int iwl_sar_get_wgds_table(struct iwl_fw_runtime *fwrt)
867
867
entry = & wifi_pkg -> package .elements [entry_idx ];
868
868
entry_idx ++ ;
869
869
if (entry -> type != ACPI_TYPE_INTEGER ||
870
- entry -> integer .value > num_profiles ) {
870
+ entry -> integer .value > num_profiles ||
871
+ entry -> integer .value <
872
+ rev_data [idx ].min_profiles ) {
871
873
ret = - EINVAL ;
872
874
goto out_free ;
873
875
}
874
- num_profiles = entry -> integer .value ;
875
876
876
877
/*
877
- * this also validates >= min_profiles since we
878
- * otherwise wouldn't have gotten the data when
879
- * looking up in ACPI
878
+ * Check to see if we received package count
879
+ * same as max # of profiles
880
880
*/
881
881
if (wifi_pkg -> package .count !=
882
882
hdr_size + profile_size * num_profiles ) {
883
883
ret = - EINVAL ;
884
884
goto out_free ;
885
885
}
886
+
887
+ /* Number of valid profiles */
888
+ num_profiles = entry -> integer .value ;
886
889
}
887
890
goto read_table ;
888
891
}
You can’t perform that action at this time.
0 commit comments