diff options
author | Dawei Li <dawei.li@shingroup.cn> | 2024-03-04 13:16:53 +0300 |
---|---|---|
committer | Conor Dooley <conor.dooley@microchip.com> | 2024-03-04 22:18:16 +0300 |
commit | af1e0a7d39f98c0dea1b186a76fcee7da6a5f7bc (patch) | |
tree | d0f045c7cfd2bc3c3cf4d5189a15298ad7366917 /drivers/firmware/microchip | |
parent | 6613476e225e090cc9aad49be7fa504e290dd33d (diff) | |
download | linux-af1e0a7d39f98c0dea1b186a76fcee7da6a5f7bc.tar.xz |
firmware: microchip: Fix over-requested allocation size
cocci warnings: (new ones prefixed by >>)
>> drivers/firmware/microchip/mpfs-auto-update.c:387:72-78:
ERROR: application of sizeof to pointer
drivers/firmware/microchip/mpfs-auto-update.c:170:72-78:
ERROR: application of sizeof to pointer
response_msg is a pointer to u32, so the size of element it points to is
supposed to be a multiple of sizeof(u32), rather than sizeof(u32 *).
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403040516.CYxoWTXw-lkp@intel.com/
Signed-off-by: Dawei Li <dawei.li@shingroup.cn>
Fixes: ec5b0f1193ad ("firmware: microchip: add PolarFire SoC Auto Update support")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Diffstat (limited to 'drivers/firmware/microchip')
-rw-r--r-- | drivers/firmware/microchip/mpfs-auto-update.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/firmware/microchip/mpfs-auto-update.c b/drivers/firmware/microchip/mpfs-auto-update.c index 81f5f62e34fc..32394c24b37d 100644 --- a/drivers/firmware/microchip/mpfs-auto-update.c +++ b/drivers/firmware/microchip/mpfs-auto-update.c @@ -384,7 +384,8 @@ static int mpfs_auto_update_available(struct mpfs_auto_update_priv *priv) u32 *response_msg; int ret; - response_msg = devm_kzalloc(priv->dev, AUTO_UPDATE_FEATURE_RESP_SIZE * sizeof(response_msg), + response_msg = devm_kzalloc(priv->dev, + AUTO_UPDATE_FEATURE_RESP_SIZE * sizeof(*response_msg), GFP_KERNEL); if (!response_msg) return -ENOMEM; |