From: Conor Dooley Date: Wed, 10 Apr 2024 11:58:05 +0000 (+0100) Subject: firmware: microchip: don't unconditionally print validation success X-Git-Tag: v6.8.10~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4006e506092528c07e02d19b0f947f068ee24904;p=thirdparty%2Fkernel%2Fstable.git firmware: microchip: don't unconditionally print validation success [ 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 Signed-off-by: Sasha Levin --- diff --git a/drivers/firmware/microchip/mpfs-auto-update.c b/drivers/firmware/microchip/mpfs-auto-update.c index fbeeaee4ac856..23134ffc4dfc6 100644 --- a/drivers/firmware/microchip/mpfs-auto-update.c +++ b/drivers/firmware/microchip/mpfs-auto-update.c @@ -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);