diff options
| author | Hans Verkuil <[email protected]> | 2019-06-29 13:00:10 +0000 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2019-07-11 12:59:54 +0000 |
| commit | 6bda7073f335db261345d403123d9a8c0bc1e36b (patch) | |
| tree | 41422ed6eb789dd514e8b6cacf721ee68b632808 /drivers/media/v4l2-core/v4l2-subdev.c | |
| parent | media: allegro: use new v4l2_m2m_ioctl_try_encoder_cmd funcs (diff) | |
| download | kernel-6bda7073f335db261345d403123d9a8c0bc1e36b.tar.gz kernel-6bda7073f335db261345d403123d9a8c0bc1e36b.zip | |
media: v4l2-subdev: fix regression in check_pad()
sd->entity.graph_obj.mdev can be NULL when this function is called, and
that breaks existing drivers (rcar-vin, but probably others as well).
Check if sd->entity.num_pads is non-zero instead since that doesn't depend
on mdev.
Signed-off-by: Hans Verkuil <[email protected]>
Reported-by: Niklas Söderlund <[email protected]>
Fixes: a8fa55078a77 ("media: v4l2-subdev: Verify arguments in v4l2_subdev_call()")
Tested-by: Niklas Söderlund <[email protected]>
Tested-by: Geert Uytterhoeven <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-subdev.c')
| -rw-r--r-- | drivers/media/v4l2-core/v4l2-subdev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index 21fb90d66bfc..25c73c13cc7e 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -124,7 +124,7 @@ static inline int check_which(__u32 which) static inline int check_pad(struct v4l2_subdev *sd, __u32 pad) { #if defined(CONFIG_MEDIA_CONTROLLER) - if (sd->entity.graph_obj.mdev) { + if (sd->entity.num_pads) { if (pad >= sd->entity.num_pads) return -EINVAL; return 0; |
