]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: dw2102: Fix memleak on sequence of probes
authorAnton Vasilyev <vasilyev@ispras.ru>
Mon, 23 Jul 2018 17:04:54 +0000 (13:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Sep 2018 20:43:39 +0000 (22:43 +0200)
commit6b7c7186c210df8fd3f2bd6f074715f4ac07979b
treea3e1cf1005dc1851863b2cd59c40d1dd56cd3de2
parentcbd5e67820a998cfb7f3d7a1b995d0bc2a1f00f7
media: dw2102: Fix memleak on sequence of probes

[ Upstream commit 299c7007e93645067e1d2743f4e50156de78c4ff ]

Each call to dw2102_probe() allocates memory by kmemdup for structures
p1100, s660, p7500 and s421, but there is no their deallocation.
dvb_usb_device_init() copies the corresponding structure into
dvb_usb_device->props, so there is no use of original structure after
dvb_usb_device_init().

The patch moves structures from global scope to local and adds their
deallocation.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/dvb-usb/dw2102.c