Skip to content

Commit 54d9135

Browse files
ricardonrafaeljw
authored andcommitted
thermal: intel: hfi: Improve the type of hfi_features::nr_table_pages
A Coverity static code scan raised a potential overflow_before_widen warning when hfi_features::nr_table_pages is used as an argument to memcpy in intel_hfi_process_event(). Even though the overflow can never happen (the maximum number of pages of the HFI table is 0x10 and 0x10 << PAGE_SHIFT = 0x10000), using size_t as the data type of hfi_features::nr_table_pages makes Coverity happy and matches the data type of the argument 'size' of memcpy(). Signed-off-by: Ricardo Neri <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 247f34f commit 54d9135

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/thermal/intel/intel_hfi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ struct hfi_instance {
137137
* Parameters and supported features that are common to all HFI instances
138138
*/
139139
struct hfi_features {
140-
unsigned int nr_table_pages;
140+
size_t nr_table_pages;
141141
unsigned int cpu_stride;
142142
unsigned int hdr_size;
143143
};

0 commit comments

Comments
 (0)