OSDN Git Service

media: em28xx: Fix exception handling in em28xx_alloc_urbs()
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 26 Aug 2019 11:14:02 +0000 (08:14 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:51:07 +0000 (14:51 +0100)
commit767686f5ebdd14a9b2a454cf832b1de7f8ca5d88
tree06352a62e3f28d18647e34a66d9a04f253f56f9d
parent1499054da857f7426e7d1e1cb453ca24aac32c83
media: em28xx: Fix exception handling in em28xx_alloc_urbs()

[ Upstream commit ecbce48f1ff2442371ebcd12ec0ecddb431fbd72 ]

A null pointer would be passed to a call of the function "kfree" directly
after a call of the function "kcalloc" failed at one place.
Pass the data structure member "urb" instead for which memory
was allocated before (so that this resource will be properly cleaned up).

This issue was detected by using the Coccinelle software.

Fixes: d571b592c6206d33731f41aa710fa0f69ac8611b ("media: em28xx: don't use coherent buffer for DMA transfers")
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/em28xx/em28xx-core.c