diff options
author | Chen Haonan <chen.haonan2@zte.com.cn> | 2024-01-09 09:24:11 +0300 |
---|---|---|
committer | Danilo Krummrich <dakr@redhat.com> | 2024-01-09 20:40:55 +0300 |
commit | 632ca3c92f3840d91ba7ddda0271f84813036a11 (patch) | |
tree | c9706fcc481b99c872329dc4bf0e407a973d3924 /drivers/gpu/drm/nouveau | |
parent | ca077ff8cac5af8a5a3c476983a6dd54aa3511b7 (diff) | |
download | linux-632ca3c92f3840d91ba7ddda0271f84813036a11.tar.xz |
drm/nouveau/disp: switch to use kmemdup() helper
Use kmemdup() helper instead of open-coding to
simplify the code.
Signed-off-by: Chen Haonan <chen.haonan2@zte.com.cn>
Reviewed-by: Yang Guang <yang.guang5@zte.com.cn>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/202401091424115185126@zte.com.cn
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvif/outp.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nvif/outp.c b/drivers/gpu/drm/nouveau/nvif/outp.c index 5d3190c05250..6daeb7f0b09b 100644 --- a/drivers/gpu/drm/nouveau/nvif/outp.c +++ b/drivers/gpu/drm/nouveau/nvif/outp.c @@ -452,13 +452,12 @@ nvif_outp_edid_get(struct nvif_outp *outp, u8 **pedid) if (ret) goto done; - *pedid = kmalloc(args->size, GFP_KERNEL); + *pedid = kmemdup(args->data, args->size, GFP_KERNEL); if (!*pedid) { ret = -ENOMEM; goto done; } - memcpy(*pedid, args->data, args->size); ret = args->size; done: kfree(args); |