linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Philipp Stanner <pstanner@redhat.com>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Dave Airlie <airlied@redhat.com>
Subject: Re: [PATCH] drivers/video/fbdev: use new array-copying-wrapper
Date: Sun, 5 Nov 2023 19:17:40 +0100	[thread overview]
Message-ID: <e9ff2894-e04c-4772-ab5d-595e0df460ae@gmx.de> (raw)
In-Reply-To: <20231102192402.53721-2-pstanner@redhat.com>

On 11/2/23 20:24, Philipp Stanner wrote:
> viafbdev.c utilizes memdup_user() to copy an array from userspace.
>
> There is a new wrapper, specifically designed for copying arrays. Use
> this one instead.
>
> Suggested-by: Dave Airlie <airlied@redhat.com>
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>

applied.

Thanks!
Helge


> ---
>   drivers/video/fbdev/via/viafbdev.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/via/viafbdev.c b/drivers/video/fbdev/via/viafbdev.c
> index 58868f8880d6..a52b1ba43a48 100644
> --- a/drivers/video/fbdev/via/viafbdev.c
> +++ b/drivers/video/fbdev/via/viafbdev.c
> @@ -574,7 +574,7 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
>   		break;
>
>   	case VIAFB_SET_GAMMA_LUT:
> -		viafb_gamma_table = memdup_user(argp, 256 * sizeof(u32));
> +		viafb_gamma_table = memdup_array_user(argp, 256, sizeof(u32));
>   		if (IS_ERR(viafb_gamma_table))
>   			return PTR_ERR(viafb_gamma_table);
>   		viafb_set_gamma_table(viafb_bpp, viafb_gamma_table);


      reply	other threads:[~2023-11-05 18:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 19:24 [PATCH] drivers/video/fbdev: use new array-copying-wrapper Philipp Stanner
2023-11-05 18:17 ` Helge Deller [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=e9ff2894-e04c-4772-ab5d-595e0df460ae@gmx.de \
    --to=deller@gmx.de \
    --cc=FlorianSchandinat@gmx.de \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pstanner@redhat.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;
as well as URLs for NNTP newsgroup(s).