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)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 29 Aug 2019 13:22:20 +0000 (10:22 -0300)
commitecbce48f1ff2442371ebcd12ec0ecddb431fbd72
tree5ef9f9a528d9ab9b40f4d3f7599b1ae9e9031c31
parent95c520690f5fafb2cda2ec17f8c76ab3422b0174
media: em28xx: Fix exception handling in em28xx_alloc_urbs()

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>
drivers/media/usb/em28xx/em28xx-core.c