media: dw2102: Fix memleak on sequence of probes
authorAnton Vasilyev <vasilyev@ispras.ru>
Mon, 23 Jul 2018 17:04:54 +0000 (13:04 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 2 Aug 2018 22:53:42 +0000 (18:53 -0400)
commit299c7007e93645067e1d2743f4e50156de78c4ff
tree106fd7587c802bb2b1c5db0287098c2c23f68136
parent1b7369acc465ddf3d9c7604af3971753b9a548f2
media: dw2102: Fix memleak on sequence of probes

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>
drivers/media/usb/dvb-usb/dw2102.c