diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-12-16 21:19:50 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-01-02 18:52:35 +0100 |
commit | eaf95eeec47e41f30139eaad8c0f3d33c5059d22 (patch) | |
tree | d5b5fd9e23b5e57b7a117fc3afe80ab0dea6a215 /drivers | |
parent | [media] exynos4-is: Remove dependency on PM_RUNTIME from Kconfig (diff) | |
download | linux-eaf95eeec47e41f30139eaad8c0f3d33c5059d22.tar.xz linux-eaf95eeec47e41f30139eaad8c0f3d33c5059d22.zip |
[media] v4l: omap4iss: use snprintf() to make smatch happy
Smatch complains here because name is a 32 character buffer and we
adding the "OMAP4 ISS " prefix as well for a total of 42 characters.
The sd->name buffer can only hold 32 characters. I've changed it to use
snprintf() to silence the overflow warning.
Also I have removed the call to strlcpy() which is a no-op.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/omap4iss/iss_csi2.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/media/omap4iss/iss_csi2.c b/drivers/staging/media/omap4iss/iss_csi2.c index e4fc4a0b69db..61fc350eb251 100644 --- a/drivers/staging/media/omap4iss/iss_csi2.c +++ b/drivers/staging/media/omap4iss/iss_csi2.c @@ -1247,8 +1247,7 @@ static int csi2_init_entities(struct iss_csi2_device *csi2, const char *subname) v4l2_subdev_init(sd, &csi2_ops); sd->internal_ops = &csi2_internal_ops; sprintf(name, "CSI2%s", subname); - strlcpy(sd->name, "", sizeof(sd->name)); - sprintf(sd->name, "OMAP4 ISS %s", name); + snprintf(sd->name, sizeof(sd->name), "OMAP4 ISS %s", name); sd->grp_id = 1 << 16; /* group ID for iss subdevs */ v4l2_set_subdevdata(sd, csi2); |