Commit 632ca3c9 authored by Chen Haonan's avatar Chen Haonan Committed by Danilo Krummrich
Browse files

drm/nouveau/disp: switch to use kmemdup() helper



Use kmemdup() helper instead of open-coding to
simplify the code.

Signed-off-by: default avatarChen Haonan <chen.haonan2@zte.com.cn>
Reviewed-by: default avatarYang Guang <yang.guang5@zte.com.cn>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarDanilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/202401091424115185126@zte.com.cn
parent ca077ff8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);