public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH  1/1] firmware: microchip: fix wrong sizeof argument
@ 2024-01-25 21:19 Samasth Norway Ananda
  2024-01-29 18:53 ` Conor Dooley
  0 siblings, 1 reply; 2+ messages in thread
From: Samasth Norway Ananda @ 2024-01-25 21:19 UTC (permalink / raw)
  To: conor.dooley, daire.mcnamara; +Cc: samasth.norway.ananda, linux-riscv

response_msg is a pointer to an unsigned int (u32). So passing just
response_msg to sizeof would not print the size of the variable. To get
the size of response_msg we need to pass it as a pointer variable.

Fixes: ec5b0f1193ad ("firmware: microchip: add PolarFire SoC Auto Update support")
Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
---
 drivers/firmware/microchip/mpfs-auto-update.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/microchip/mpfs-auto-update.c b/drivers/firmware/microchip/mpfs-auto-update.c
index 81f5f62e34fc..682e417be5a3 100644
--- a/drivers/firmware/microchip/mpfs-auto-update.c
+++ b/drivers/firmware/microchip/mpfs-auto-update.c
@@ -167,7 +167,7 @@ static int mpfs_auto_update_verify_image(struct fw_upload *fw_uploader)
 	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;
-- 
2.42.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] firmware: microchip: fix wrong sizeof argument
  2024-01-25 21:19 [PATCH 1/1] firmware: microchip: fix wrong sizeof argument Samasth Norway Ananda
@ 2024-01-29 18:53 ` Conor Dooley
  0 siblings, 0 replies; 2+ messages in thread
From: Conor Dooley @ 2024-01-29 18:53 UTC (permalink / raw)
  To: daire.mcnamara, Samasth Norway Ananda; +Cc: conor, Conor Dooley, linux-riscv

From: Conor Dooley <conor.dooley@microchip.com>

On Thu, 25 Jan 2024 13:19:33 -0800, Samasth Norway Ananda wrote:
> response_msg is a pointer to an unsigned int (u32). So passing just
> response_msg to sizeof would not print the size of the variable. To get
> the size of response_msg we need to pass it as a pointer variable.
> 
> 

Applied to riscv-soc-drivers-fixes, thanks!

[1/1] firmware: microchip: fix wrong sizeof argument
      https://git.kernel.org/conor/c/0abcac4fe3ca

Thanks,
Conor.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-29 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-25 21:19 [PATCH 1/1] firmware: microchip: fix wrong sizeof argument Samasth Norway Ananda
2024-01-29 18:53 ` Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox