From: Thomas Zimmermann <tzimmermann@suse.de>
To: Ethan Tidmore <ethantidmore06@gmail.com>, lanzano.alex@gmail.com
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
airlied@gmail.com, simona@ffwll.ch, lumag@kernel.org,
mehdi.djait@bootlin.com, u.kleine-koenig@baylibre.com,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/tiny: sharp-memory: fix pointer error dereference
Date: Tue, 17 Feb 2026 09:41:36 +0100 [thread overview]
Message-ID: <885e4324-ab9b-476a-9c69-afc3d9e894e4@suse.de> (raw)
In-Reply-To: <20260216040438.43702-1-ethantidmore06@gmail.com>
Am 16.02.26 um 05:04 schrieb Ethan Tidmore:
> The function devm_drm_dev_alloc() returns a pointer error upon failure
> not NULL. Change null check to pointer error check.
>
> Detected by Smatch:
> drivers/gpu/drm/tiny/sharp-memory.c:549 sharp_memory_probe() error:
> 'smd' dereferencing possible ERR_PTR()
>
> Fixes: b8f9f21716fec ("drm/tiny: Add driver for Sharp Memory LCD")
> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for the fix.
> ---
> drivers/gpu/drm/tiny/sharp-memory.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/tiny/sharp-memory.c b/drivers/gpu/drm/tiny/sharp-memory.c
> index 64272cd0f6e2..cbf69460ebf3 100644
> --- a/drivers/gpu/drm/tiny/sharp-memory.c
> +++ b/drivers/gpu/drm/tiny/sharp-memory.c
> @@ -541,8 +541,8 @@ static int sharp_memory_probe(struct spi_device *spi)
>
> smd = devm_drm_dev_alloc(dev, &sharp_memory_drm_driver,
> struct sharp_memory_device, drm);
> - if (!smd)
> - return -ENOMEM;
> + if (IS_ERR(smd))
> + return PTR_ERR(smd);
>
> spi_set_drvdata(spi, smd);
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
prev parent reply other threads:[~2026-02-17 8:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 4:04 [PATCH] drm/tiny: sharp-memory: fix pointer error dereference Ethan Tidmore
2026-02-16 6:10 ` Uwe Kleine-König
2026-02-17 8:41 ` Thomas Zimmermann [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=885e4324-ab9b-476a-9c69-afc3d9e894e4@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ethantidmore06@gmail.com \
--cc=lanzano.alex@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mehdi.djait@bootlin.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=u.kleine-koenig@baylibre.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