]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: dvb-core: fix a memory leak bug
authorWenwen Wang <wenwen@cs.uga.edu>
Sun, 18 Aug 2019 03:45:40 +0000 (00:45 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 10:30:23 +0000 (12:30 +0200)
commit9db28659aa893c68f162b11fd63bb7f6a713e52f
tree192df1c1a38918980f41c03b30d301079ed0c0a0
parentc18b0a3b31a84095910425214b1495eac27e0916
media: dvb-core: fix a memory leak bug

[ Upstream commit fcd5ce4b3936242e6679875a4d3c3acfc8743e15 ]

In dvb_create_media_entity(), 'dvbdev->entity' is allocated through
kzalloc(). Then, 'dvbdev->pads' is allocated through kcalloc(). However, if
kcalloc() fails, the allocated 'dvbdev->entity' is not deallocated, leading
to a memory leak bug. To fix this issue, free 'dvbdev->entity' before
returning -ENOMEM.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/dvb-core/dvbdev.c