diff options
author | Saud Farooqui <farooqui_saud@hotmail.com> | 2022-06-23 12:20:47 +0300 |
---|---|---|
committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2022-06-24 20:37:00 +0300 |
commit | 99de6509c4135f1d1ceb98c42fa02d249b28b40f (patch) | |
tree | 1d76b1bebc643b7e0121b4d06a6def392e012507 /drivers/rpmsg/rpmsg_core.c | |
parent | d7bd416d35121c95fe47330e09a5c04adbc5f928 (diff) | |
download | linux-99de6509c4135f1d1ceb98c42fa02d249b28b40f.tar.xz |
rpmsg: Strcpy is not safe, use strscpy_pad() instead
Replace strcpy() with strscpy_pad() for copying the rpmsg
device name in rpmsg_register_device_override().
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Saud Farooqui <farooqui_saud@hotmail.com>
Link: https://lore.kernel.org/r/PA4P189MB14210AA95DCA3715AFA7F4A68BB59@PA4P189MB1421.EURP189.PROD.OUTLOOK.COM
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'drivers/rpmsg/rpmsg_core.c')
-rw-r--r-- | drivers/rpmsg/rpmsg_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index 5a47cad89fdc..d6dde00efdae 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -604,7 +604,7 @@ int rpmsg_register_device_override(struct rpmsg_device *rpdev, int ret; if (driver_override) - strcpy(rpdev->id.name, driver_override); + strscpy_pad(rpdev->id.name, driver_override, RPMSG_NAME_SIZE); dev_set_name(dev, "%s.%s.%d.%d", dev_name(dev->parent), rpdev->id.name, rpdev->src, rpdev->dst); |