From: <yang.guang5@zte.com.cn>
To: <lee@kernel.org>
Cc: <jiang.xuexin@zte.com.cn>, <chen.haonan2@zte.com.cn>,
<cgel.zte@gmail.com>, <patches@opensource.cirrus.com>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH linux-next] drm/nouveau/disp: switch to use kmemdup() helper
Date: Thu, 14 Dec 2023 19:55:20 +0800 (CST) [thread overview]
Message-ID: <202312141955202416240@zte.com.cn> (raw)
From: Yang Guang <yang.guang5@zte.com.cn>
Use kmemdup() helper instead of open-coding to
simplify the code.
Signed-off-by: Chen Haonan <chen.haonan2@zte.com.cn>
---
drivers/gpu/drm/nouveau/nvif/outp.c | 3 +--
1 file changed, 1 insertion(+), 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);
--
2.25.1
next reply other threads:[~2023-12-14 11:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 11:55 yang.guang5 [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-12-14 12:03 [PATCH linux-next] drm/nouveau/disp: switch to use kmemdup() helper yang.guang5
2023-12-14 16:20 ` Kees Cook
2024-01-08 17:18 ` Danilo Krummrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202312141955202416240@zte.com.cn \
--to=yang.guang5@zte.com.cn \
--cc=cgel.zte@gmail.com \
--cc=chen.haonan2@zte.com.cn \
--cc=jiang.xuexin@zte.com.cn \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox