Commit 2289adbf authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Mauro Carvalho Chehab
Browse files

media: usb: fix memory leak in af9005_identify_state



In af9005_identify_state when returning -EIO the allocated buffer should
be released. Replace the "return -EIO" with assignment into ret and move
deb_info() under a check.

Fixes: af4e067e ("V4L/DVB (5625): Add support for the AF9005 demodulator from Afatech")
Signed-off-by: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 69e3235d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -976,7 +976,8 @@ static int af9005_identify_state(struct usb_device *udev,
	else if (reply == 0x02)
		*cold = 0;
	else
		return -EIO;
		ret = -EIO;
	if (!ret)
		deb_info("Identify state cold = %d\n", *cold);

err: