]> git.dujemihanovic.xyz Git - linux.git/commitdiff
firmware: microchip: fix wrong sizeof argument
authorSamasth Norway Ananda <samasth.norway.ananda@oracle.com>
Thu, 25 Jan 2024 21:19:33 +0000 (13:19 -0800)
committerConor Dooley <conor.dooley@microchip.com>
Mon, 29 Jan 2024 18:52:11 +0000 (18:52 +0000)
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>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
drivers/firmware/microchip/mpfs-auto-update.c

index 81f5f62e34fce04fb6db2db11294f8281c58f5b7..682e417be5a3e49d3a4bc8c63bac963670f09af1 100644 (file)
@@ -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;