[media] v4l2-ctrls.c: add NULL check
Check that the control whose events we want to delete is still there. Normally this will always be the case, but I am not 100% certain if there aren't any corner cases when a device is forcibly unbound. In any case, this will satisfy static checkers and simply make it more robust. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reported-by: Shaobo <shaobo@cs.utah.edu> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
75d1b1379f
commit
814e92b8ca
@ -3367,6 +3367,9 @@ static void v4l2_ctrl_del_event(struct v4l2_subscribed_event *sev)
|
||||
{
|
||||
struct v4l2_ctrl *ctrl = v4l2_ctrl_find(sev->fh->ctrl_handler, sev->id);
|
||||
|
||||
if (ctrl == NULL)
|
||||
return;
|
||||
|
||||
v4l2_ctrl_lock(ctrl);
|
||||
list_del(&sev->node);
|
||||
v4l2_ctrl_unlock(ctrl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user