Skip to content

Commit 8b4143d

Browse files
Niklas Söderlundrkhuangtao
authored andcommitted
UPSTREAM: [media] v4l: async: check for v4l2_dev in v4l2_async_notifier_register()
Add a check for v4l2_dev to v4l2_async_notifier_register() as to fail as early as possible since this will fail later in v4l2_async_test_notify(). Signed-off-by: Niklas Sderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> (cherry picked from commit fbf1e94f0055d825f8d56b3abe322f37ba818d5a) Signed-off-by: Marc Herbert <marc.herbert@intel.com> BUG=b:64133998 TEST=media device topology shows subdevs registered successfully TEST=no camera regression Change-Id: Ia70aba4657c1fff04a906bcd182c1c30accd21cf Reviewed-on: https://chromium-review.googlesource.com/693692 Commit-Ready: Tomasz Figa <tfiga@chromium.org> Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
1 parent c46d1b7 commit 8b4143d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/media/v4l2-core/v4l2-async.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev,
148148
struct v4l2_async_subdev *asd;
149149
int i;
150150

151-
if (!notifier->num_subdevs || notifier->num_subdevs > V4L2_MAX_SUBDEVS)
151+
if (!v4l2_dev || !notifier->num_subdevs ||
152+
notifier->num_subdevs > V4L2_MAX_SUBDEVS)
152153
return -EINVAL;
153154

154155
notifier->v4l2_dev = v4l2_dev;

0 commit comments

Comments
 (0)