From: Danilo Krummrich <dakr@redhat.com>
To: yang.guang5@zte.com.cn
Cc: keescook@chromium.org, cgel.zte@gmail.com,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
chen.haonan2@zte.com.cn, bskeggs@redhat.com,
jiang.xuexin@zte.com.cn, nouveau@lists.freedesktop.org
Subject: Re: [PATCH linux-next v2] drm/nouveau/disp: switch to use kmemdup() helper
Date: Wed, 10 Jan 2024 16:15:38 +0100 [thread overview]
Message-ID: <c8bbb32d-5fc5-4682-a92c-e5e102fa0866@redhat.com> (raw)
In-Reply-To: <202401091424115185126@zte.com.cn>
On 1/9/24 07:24, yang.guang5@zte.com.cn wrote:
> From: Chen Haonan <chen.haonan2@zte.com.cn>
>
> 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>
Applied to drm-misc-next, thanks!
> ---
> 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);
prev parent reply other threads:[~2024-01-10 15:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-09 6:24 [PATCH linux-next v2] drm/nouveau/disp: switch to use kmemdup() helper yang.guang5
2024-01-10 15:15 ` Danilo Krummrich [this message]
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=c8bbb32d-5fc5-4682-a92c-e5e102fa0866@redhat.com \
--to=dakr@redhat.com \
--cc=bskeggs@redhat.com \
--cc=cgel.zte@gmail.com \
--cc=chen.haonan2@zte.com.cn \
--cc=dri-devel@lists.freedesktop.org \
--cc=jiang.xuexin@zte.com.cn \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=yang.guang5@zte.com.cn \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).