media: saa7146: add cleanup in hexium_attach()
authorWenwen Wang <wenwen@cs.uga.edu>
Sun, 18 Aug 2019 05:40:14 +0000 (02:40 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 10:30:23 +0000 (12:30 +0200)
commit71ee91c8ca70d48a3f49cc4f8c5f7fae57e23997
tree0c6e43e1812950e6445a14976791659e65432fab
parent4ebe3a8fd0996685985507f37da21368459944ab
media: saa7146: add cleanup in hexium_attach()

[ Upstream commit 42e64117d3b4a759013f77bbcf25ab6700e55de7 ]

If saa7146_register_device() fails, no cleanup is executed, leading to
memory/resource leaks. To fix this issue, perform necessary cleanup work
before returning the error.

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>
drivers/media/pci/saa7146/hexium_gemini.c