]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
media: cpia2_usb: fix memory leaks
authorWenwen Wang <wenwen@cs.uga.edu>
Sat, 17 Aug 2019 05:27:46 +0000 (02:27 -0300)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 16 Oct 2019 09:55:25 +0000 (11:55 +0200)
commit482c23de82c71c4678b6f5153e1ca6f74b33533b
treea6ed8c39d16e1d5ef64aab5ac91797d6c1563240
parent71496c4705ae107af1b3eaf915f891343c73458c
media: cpia2_usb: fix memory leaks

BugLink: https://bugs.launchpad.net/bugs/1847155
[ Upstream commit 1c770f0f52dca1a2323c594f01f5ec6f1dddc97f ]

In submit_urbs(), 'cam->sbuf[i].data' is allocated through kmalloc_array().
However, it is not deallocated if the following allocation for urbs fails.
To fix this issue, free 'cam->sbuf[i].data' if usb_alloc_urb() fails.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/media/usb/cpia2/cpia2_usb.c