summaryrefslogtreecommitdiffstats
path: root/drivers/thermal
diff options
context:
space:
mode:
authorRicardo Neri <ricardo.neri-calderon@linux.intel.com>2022-10-18 04:22:40 -0700
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-10-28 20:11:48 +0200
commit54d9135cf223f221546bd51b0f5e4a73e99891f4 (patch)
tree02496ca8052766938a3044a911e0506900d0e884 /drivers/thermal
parent247f34f7b80357943234f93f247a1ae6b6c3a740 (diff)
downloadlinux-stable-54d9135cf223f221546bd51b0f5e4a73e99891f4.tar.gz
linux-stable-54d9135cf223f221546bd51b0f5e4a73e99891f4.tar.bz2
linux-stable-54d9135cf223f221546bd51b0f5e4a73e99891f4.zip
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 <ricardo.neri-calderon@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/intel/intel_hfi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c
index a0640f762dc5..239afe02e518 100644
--- a/drivers/thermal/intel/intel_hfi.c
+++ b/drivers/thermal/intel/intel_hfi.c
@@ -137,7 +137,7 @@ struct hfi_instance {
* Parameters and supported features that are common to all HFI instances
*/
struct hfi_features {
- unsigned int nr_table_pages;
+ size_t nr_table_pages;
unsigned int cpu_stride;
unsigned int hdr_size;
};