Skip to content

Commit af1e0a7

Browse files
Dawei LiConchuOD
authored andcommitted
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: ec5b0f1 ("firmware: microchip: add PolarFire SoC Auto Update support") Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
1 parent 6613476 commit af1e0a7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/firmware/microchip/mpfs-auto-update.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,8 @@ static int mpfs_auto_update_available(struct mpfs_auto_update_priv *priv)
384384
u32 *response_msg;
385385
int ret;
386386

387-
response_msg = devm_kzalloc(priv->dev, AUTO_UPDATE_FEATURE_RESP_SIZE * sizeof(response_msg),
387+
response_msg = devm_kzalloc(priv->dev,
388+
AUTO_UPDATE_FEATURE_RESP_SIZE * sizeof(*response_msg),
388389
GFP_KERNEL);
389390
if (!response_msg)
390391
return -ENOMEM;

0 commit comments

Comments
 (0)