diff options
| author | Mauro Carvalho Chehab <[email protected]> | 2018-09-10 12:19:14 +0000 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2018-09-11 17:32:17 +0000 |
| commit | c0decac19da3906d9b66291e57b7759489e1170f (patch) | |
| tree | 0eeb1f7d2c5464e0c87e0c788fd8fb581662c621 /drivers/media/platform/vimc/vimc-core.c | |
| parent | media: MAINTAINERS: add entry for i.MX PXP media mem2mem driver (diff) | |
| download | kernel-c0decac19da3906d9b66291e57b7759489e1170f.tar.gz kernel-c0decac19da3906d9b66291e57b7759489e1170f.zip | |
media: use strscpy() instead of strlcpy()
The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL terminated strings.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'drivers/media/platform/vimc/vimc-core.c')
| -rw-r--r-- | drivers/media/platform/vimc/vimc-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c index 9246f265de31..ce809d2e3d53 100644 --- a/drivers/media/platform/vimc/vimc-core.c +++ b/drivers/media/platform/vimc/vimc-core.c @@ -259,7 +259,7 @@ static struct component_match *vimc_add_subdevs(struct vimc_device *vimc) dev_dbg(&vimc->pdev.dev, "new pdev for %s\n", vimc->pipe_cfg->ents[i].drv); - strlcpy(pdata.entity_name, vimc->pipe_cfg->ents[i].name, + strscpy(pdata.entity_name, vimc->pipe_cfg->ents[i].name, sizeof(pdata.entity_name)); vimc->subdevs[i] = platform_device_register_data(&vimc->pdev.dev, @@ -317,7 +317,7 @@ static int vimc_probe(struct platform_device *pdev) vimc->v4l2_dev.mdev = &vimc->mdev; /* Initialize media device */ - strlcpy(vimc->mdev.model, VIMC_MDEV_MODEL_NAME, + strscpy(vimc->mdev.model, VIMC_MDEV_MODEL_NAME, sizeof(vimc->mdev.model)); vimc->mdev.dev = &pdev->dev; media_device_init(&vimc->mdev); |
