Mauro Carvalho Chehab wrote:
On Mon, 12 Jan 2009 20:03:08 -0600
"Aguirre Rodriguez, Sergio Alberto" <saaguirre@xxxxxx> wrote:
+static struct v4l2_int_slave dummy_slave = {
+ /* Dummy pointer to avoid underflow in find_ioctl. */
+ .ioctls = (void *)0x80000000,
Why are you using here a magic number?
Not really a reason. It could be or actually perhaps anything equal to
or bigger than sizeof(struct v4l2_int_ioctl_desc) so that last doesn't
underflow:
const struct v4l2_int_ioctl_desc *first = slave->ioctls;
const struct v4l2_int_ioctl_desc *last =
first + slave->num_ioctls - 1;
num_ioctls is zero. See find_ioctl in drivers/media/video/v4l2-int-device.c.
I guess that should be changed to sizeof(struct v4l2_int_ioctl_desc).
--
Sakari Ailus
sakari.ailus@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html