diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2014-01-29 08:07:13 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-05-25 11:48:33 -0400 |
commit | f2e9084779d3ad3b51ee45a3a53fead3f16516ca (patch) | |
tree | 79dc867b483e692582d373e41e5840adf602f1eb /drivers/media/i2c/adv7511.c | |
parent | 9cfd65e80959836fed78704e8a127d4e10448d56 (diff) |
[media] v4l: Validate fields in the core code for subdev EDID ioctls
The subdev EDID ioctls receive a pad field that must reference an
existing pad and an EDID field that must point to a buffer. Validate
both fields in the core code instead of duplicating validation in all
drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/i2c/adv7511.c')
-rw-r--r-- | drivers/media/i2c/adv7511.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c index d77a1db4f94d..f98acf4aafd4 100644 --- a/drivers/media/i2c/adv7511.c +++ b/drivers/media/i2c/adv7511.c | |||
@@ -783,8 +783,6 @@ static int adv7511_get_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid) | |||
783 | return -EINVAL; | 783 | return -EINVAL; |
784 | if ((edid->blocks == 0) || (edid->blocks > 256)) | 784 | if ((edid->blocks == 0) || (edid->blocks > 256)) |
785 | return -EINVAL; | 785 | return -EINVAL; |
786 | if (!edid->edid) | ||
787 | return -EINVAL; | ||
788 | if (!state->edid.segments) { | 786 | if (!state->edid.segments) { |
789 | v4l2_dbg(1, debug, sd, "EDID segment 0 not found\n"); | 787 | v4l2_dbg(1, debug, sd, "EDID segment 0 not found\n"); |
790 | return -ENODATA; | 788 | return -ENODATA; |