media: cec: safely unhook lists in cec_data
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 24 Nov 2021 10:38:57 +0000 (11:38 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 30 Nov 2021 11:22:09 +0000 (12:22 +0100)
commit2ddd03309433d39852945c2f85d36e796c558793
treef384b343b973038d61ef1cb6b5cdf37387e290fb
parent1a59cd88f55068710f6549bee548846661673780
media: cec: safely unhook lists in cec_data

smatch warns about data->list not being removed from list:

drivers/media/cec/core/cec-adap.c:926 cec_transmit_msg_fh() warn: '&data->list' not removed from list

It is a false warning, but it doesn't hurt to make the code more robust
and safely unhook data->list and data->xfer_list together with a WARN_ON
if this is actually ever needed (this really shouldn't happen).

Note that fixing the data->list warning just replaced it with a new similar
warning for data->xfer_list, so both needed to be addressed.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/cec/core/cec-adap.c
drivers/media/cec/core/cec-api.c