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 @@ -724,22 +724,25 @@ int iwl_acpi_get_wgds_table(struct iwl_fw_runtime *fwrt)
724
724
entry = & wifi_pkg -> package .elements [entry_idx ];
725
725
entry_idx ++ ;
726
726
if (entry -> type != ACPI_TYPE_INTEGER ||
727
- entry -> integer .value > num_profiles ) {
727
+ entry -> integer .value > num_profiles ||
728
+ entry -> integer .value <
729
+ rev_data [idx ].min_profiles ) {
728
730
ret = - EINVAL ;
729
731
goto out_free ;
730
732
}
731
- num_profiles = entry -> integer .value ;
732
733
733
734
/*
734
- * this also validates >= min_profiles since we
735
- * otherwise wouldn't have gotten the data when
736
- * looking up in ACPI
735
+ * Check to see if we received package count
736
+ * same as max # of profiles
737
737
*/
738
738
if (wifi_pkg -> package .count !=
739
739
hdr_size + profile_size * num_profiles ) {
740
740
ret = - EINVAL ;
741
741
goto out_free ;
742
742
}
743
+
744
+ /* Number of valid profiles */
745
+ num_profiles = entry -> integer .value ;
743
746
}
744
747
goto read_table ;
745
748
}
You can’t perform that action at this time.
0 commit comments