media: usb: fix memory leak in af9005_identify_state
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Wed, 9 Oct 2019 15:01:47 +0000 (12:01 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2020 09:20:05 +0000 (10:20 +0100)
commit3dba6e50d09ee8c05d5ba68bd69624ac1ea0c814
tree920b64829549d10cf3fb56b223ea68b1fb3d2a04
parent56eb000be1142c3fb3a60d08ffb1cfef49996bc5
media: usb: fix memory leak in af9005_identify_state

commit 2289adbfa559050d2a38bcd9caac1c18b800e928 upstream.

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: af4e067e1dcf ("V4L/DVB (5625): Add support for the AF9005 demodulator from Afatech")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/dvb-usb/af9005.c