public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@linux•dev>
To: Dan Carpenter <error27@gmail•com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard•com>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard•com>,
	Maarten Lankhorst <maarten.lankhorst@linux•intel.com>,
	Maxime Ripard <mripard@kernel•org>,
	Thomas Zimmermann <tzimmermann@suse•de>,
	David Airlie <airlied@gmail•com>, Simona Vetter <simona@ffwll•ch>,
	Michal Simek <michal.simek@amd•com>,
	dri-devel@lists•freedesktop.org,
	linux-arm-kernel@lists•infradead.org,
	linux-kernel@vger•kernel.org, kernel-janitors@vger•kernel.org
Subject: Re: [PATCH] drm: zynqmp_dp: Fix uninitialized variable in debugfs()
Date: Wed, 27 May 2026 20:31:59 -0400	[thread overview]
Message-ID: <935aaec5-5417-3cde-f944-3c04ffbd3458@linux.dev> (raw)
In-Reply-To: <ahP3Xagt1LJrhmFl@stanley.mountain>

On 5/25/26 03:16, Dan Carpenter wrote:
> If the *ppos is non-zero then simple_write_to_buffer() will not
> initialize the start of the buf[] buffer.  It doesn't really make sense
> to allow non-zero values for *ppos, so check for that at the start and
> return -EINVAL.

non-zero ppos seems to be handled properly by simple_write_to_buffer.

--Sean

> Fixes: 28edaacb821c ("drm: zynqmp_dp: Add debugfs interface for compliance testing")
> Signed-off-by: Dan Carpenter <error27@gmail•com>
> ---
>   drivers/gpu/drm/xlnx/zynqmp_dp.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c
> index 7fb11b0a44f0..847179476041 100644
> --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c
> +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c
> @@ -1888,6 +1888,9 @@ static ssize_t zynqmp_dp_pattern_write(struct file *file,
>   	ssize_t ret;
>   	int pattern;
>   
> +	if (*ppos != 0)
> +		return -EINVAL;
> +
>   	ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf,
>   				     count);
>   	if (ret < 0)
> @@ -2028,6 +2031,9 @@ static ssize_t zynqmp_dp_custom_write(struct file *file,
>   	ssize_t ret;
>   	char buf[sizeof(dp->test.custom)];
>   
> +	if (*ppos != 0)
> +		return -EINVAL;
> +
>   	ret = simple_write_to_buffer(buf, sizeof(buf), ppos, user_buf, count);
>   	if (ret < 0)
>   		return ret;



  reply	other threads:[~2026-05-28  0:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25  7:16 [PATCH] drm: zynqmp_dp: Fix uninitialized variable in debugfs() Dan Carpenter
2026-05-28  0:31 ` Sean Anderson [this message]
2026-05-28  6:18   ` Dan Carpenter
2026-05-28  8:00     ` Sean Anderson
2026-05-28  8:59       ` Dan Carpenter

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=935aaec5-5417-3cde-f944-3c04ffbd3458@linux.dev \
    --to=sean.anderson@linux$(echo .)dev \
    --cc=airlied@gmail$(echo .)com \
    --cc=dri-devel@lists$(echo .)freedesktop.org \
    --cc=error27@gmail$(echo .)com \
    --cc=kernel-janitors@vger$(echo .)kernel.org \
    --cc=laurent.pinchart@ideasonboard$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=maarten.lankhorst@linux$(echo .)intel.com \
    --cc=michal.simek@amd$(echo .)com \
    --cc=mripard@kernel$(echo .)org \
    --cc=simona@ffwll$(echo .)ch \
    --cc=tomi.valkeinen@ideasonboard$(echo .)com \
    --cc=tzimmermann@suse$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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