mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-21 20:22:13 +08:00
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
This commit is contained in:
parent
ca077ff8ca
commit
632ca3c92f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user