]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
firmware: microchip: don't unconditionally print validation success
authorConor Dooley <conor.dooley@microchip.com>
Wed, 10 Apr 2024 11:58:05 +0000 (12:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 10:14:36 +0000 (12:14 +0200)
[ Upstream commit 6e3b7e862ea4e4ff1be1d153ae07dfe150ed8896 ]

If validation fails, both prints are made. Skip the success one in the
failure case.

Fixes: ec5b0f1193ad ("firmware: microchip: add PolarFire SoC Auto Update support")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firmware/microchip/mpfs-auto-update.c

index fbeeaee4ac85603783412b2afddd9c5ec6fafd49..23134ffc4dfc6dd468a3b88a8748cd6af71e8a30 100644 (file)
@@ -206,10 +206,12 @@ static int mpfs_auto_update_verify_image(struct fw_upload *fw_uploader)
        if (ret | response->resp_status) {
                dev_warn(priv->dev, "Verification of Upgrade Image failed!\n");
                ret = ret ? ret : -EBADMSG;
+               goto free_message;
        }
 
        dev_info(priv->dev, "Verification of Upgrade Image passed!\n");
 
+free_message:
        devm_kfree(priv->dev, message);
 free_response:
        devm_kfree(priv->dev, response);