media: pci: cx23885: handle adding to list failure
authorNicholas Mc Guire <hofrat@osadl.org>
Sun, 9 Sep 2018 16:02:32 +0000 (12:02 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Nov 2018 06:32:46 +0000 (07:32 +0100)
commit2eb66039904b7cd09c7a067d9e7917c6e3be5b97
treeafc631ca0d43825163b833189b6c57865d016b8a
parent62d3277ec764e1cd1697f74982c4bf4e153e5d78
media: pci: cx23885: handle adding to list failure

[ Upstream commit c5d59528e24ad22500347b199d52b9368e686a42 ]

altera_hw_filt_init() which calls append_internal() assumes
that the node was successfully linked in while in fact it can
silently fail. So the call-site needs to set return to -ENOMEM
on append_internal() returning NULL and exit through the err path.

Fixes: 349bcf02e361 ("[media] Altera FPGA based CI driver module")

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/pci/cx23885/altera-ci.c