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:47:55 +0000 (12:47 +0200)
commit482d117f4b26312f9b2565705d4a0352307b5f50
treea430e5cbe8e07ac2d64f11edc4537a704a0a87f6
parentfdfcf82204737e45bfaa27a4fc65298990dfac07
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