Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd9d7213 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Marcel Holtmann
Browse files

ieee802154/adf7242: fix memory leak of firmware



If the firmware upload or the firmware verification fails then we
printed the error message and exited but we missed releasing the
firmware.

Signed-off-by: default avatarSudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent feb2add3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1030,6 +1030,7 @@ static int adf7242_hw_init(struct adf7242_local *lp)
	if (ret) {
		dev_err(&lp->spi->dev,
			"upload firmware failed with %d\n", ret);
		release_firmware(fw);
		return ret;
	}

@@ -1037,6 +1038,7 @@ static int adf7242_hw_init(struct adf7242_local *lp)
	if (ret) {
		dev_err(&lp->spi->dev,
			"verify firmware failed with %d\n", ret);
		release_firmware(fw);
		return ret;
	}