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