Renesas driver updates for v5.15 (take two)
- Prefer memcpy() over strcpy(). -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCYRY/6QAKCRCKwlD9ZEnx cB1/AQDpwGk4hAvOhDn36GE47dW1B1nEyAaXIjBkQhphXT00hwEArRLShaYJWwBL vnwbPSVnW7pdU9Pp3Jf9nAJ7YuKwtQs= =txYu -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmEdC8IACgkQmmx57+YA GNmq9g/5AfLC+9Vxn+37ximafBaNus77BKWJHKMIIMO+LybbHBnUMq8CRUXb42B/ KXVTFLBkbjHHaFbzVz2bzlN9nKOCN6C/9iQGZ02hessgjIWNhH8frNyek6odWEqe CffcVhUD2/7lqvDeFsG3TOK7605ZPN6ZtmgoJoSaMv4In9gVbAA15/SLtd3BbIDP PiEpnH/wlqz2YMTvZnX4ggPYDcnI82RB2aQ5AgqfMd4MAjwMKyOJsy9PpTZtzBen 0NxyPpFGpuKvnI0YsinEcsbTRUqjmfcYwSK84Zbz3cvCc67yQgI31BOYM/cIMuCo dX2Kvl6NRIQ1DWyhUNGwAowal0D9vk/+XlrQls0i4FqtZrCoDTofhvZqlkZO9Fxx TLcX06kiXr0FtPBxZrr8IR+vTzh/sPrHh9R9GkcWW5GkcCxqbO3zm7qXkrxTWSYe CHY6/BWi6hWnLStI7RMVPzedcgFvnR967LHM2/IrbWgQwA9zkWvkk8WjL6fUyhsR yastbuleWNiszGh+njOmQKoafHXCkNuVO9FosgM9HYBxdFaYMzm4pNXzdAGbDxmD tE+tx9j4liqhq3Hj9CyfM2rK/kUskxHgGpdcp8g2ecoxJMSoiX3unSyfG23hjLf+ o+GglDVs5kbWZ1zxZBF75Re7EuWirJ8iWR6bgUweBdz9YsGfwvo= =UMRN -----END PGP SIGNATURE----- Merge tag 'renesas-drivers-for-v5.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/drivers Renesas driver updates for v5.15 (take two) - Prefer memcpy() over strcpy(). * tag 'renesas-drivers-for-v5.15-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: Prefer memcpy() over strcpy() Link: https://lore.kernel.org/r/cover.1628849625.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
63db5acb4a
@ -404,19 +404,21 @@ static int __init r8a779a0_sysc_pd_init(void)
|
||||
for (i = 0; i < info->num_areas; i++) {
|
||||
const struct r8a779a0_sysc_area *area = &info->areas[i];
|
||||
struct r8a779a0_sysc_pd *pd;
|
||||
size_t n;
|
||||
|
||||
if (!area->name) {
|
||||
/* Skip NULLified area */
|
||||
continue;
|
||||
}
|
||||
|
||||
pd = kzalloc(sizeof(*pd) + strlen(area->name) + 1, GFP_KERNEL);
|
||||
n = strlen(area->name) + 1;
|
||||
pd = kzalloc(sizeof(*pd) + n, GFP_KERNEL);
|
||||
if (!pd) {
|
||||
error = -ENOMEM;
|
||||
goto out_put;
|
||||
}
|
||||
|
||||
strcpy(pd->name, area->name);
|
||||
memcpy(pd->name, area->name, n);
|
||||
pd->genpd.name = pd->name;
|
||||
pd->pdr = area->pdr;
|
||||
pd->flags = area->flags;
|
||||
|
@ -396,19 +396,21 @@ static int __init rcar_sysc_pd_init(void)
|
||||
for (i = 0; i < info->num_areas; i++) {
|
||||
const struct rcar_sysc_area *area = &info->areas[i];
|
||||
struct rcar_sysc_pd *pd;
|
||||
size_t n;
|
||||
|
||||
if (!area->name) {
|
||||
/* Skip NULLified area */
|
||||
continue;
|
||||
}
|
||||
|
||||
pd = kzalloc(sizeof(*pd) + strlen(area->name) + 1, GFP_KERNEL);
|
||||
n = strlen(area->name) + 1;
|
||||
pd = kzalloc(sizeof(*pd) + n, GFP_KERNEL);
|
||||
if (!pd) {
|
||||
error = -ENOMEM;
|
||||
goto out_put;
|
||||
}
|
||||
|
||||
strcpy(pd->name, area->name);
|
||||
memcpy(pd->name, area->name, n);
|
||||
pd->genpd.name = pd->name;
|
||||
pd->ch.chan_offs = area->chan_offs;
|
||||
pd->ch.chan_bit = area->chan_bit;
|
||||
|
Loading…
Reference in New Issue
Block a user