From: Helge Deller <deller@gmx.de>
To: "Markus Elfring" <Markus.Elfring@web.de>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
"Kees Cook" <kees@kernel.org>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] fbdev: arkfb: Move a variable assignment behind a condition check in ics5342_init()
Date: Sat, 18 Jul 2026 20:17:16 +0200 [thread overview]
Message-ID: <40d5e392-3f99-44c9-b30a-3481f60143ba@gmx.de> (raw)
In-Reply-To: <36d0eba7-e78d-4a06-95bc-c97d9b91f8f0@web.de>
On 7/13/26 12:18, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 13 Jul 2026 12:12:52 +0200
>
> The address of a data structure member was determined before
> a corresponding null pointer check in the implementation of
> the function “ics5342_init”.
>
> Thus avoid the risk for undefined behaviour by moving the assignment
> for the variable “info” behind a condition check.
>
> This issue was detected by using the Coccinelle software.
There is no "risk" here.
It just adds an offset to a potential NULL value (which isn't then used afterwards).
Helge
> Fixes: ede481f6dad47d40b7e561cfbc6c04286a9faf1a ("fbdev: arkfb: Cast ics5342_init() allocation type")
> Cc: stable@vger.kernel.org
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/video/fbdev/arkfb.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/arkfb.c b/drivers/video/fbdev/arkfb.c
> index 195dbf4a5142..9658f407b79a 100644
> --- a/drivers/video/fbdev/arkfb.c
> +++ b/drivers/video/fbdev/arkfb.c
> @@ -432,11 +432,12 @@ static struct dac_ops ics5342_ops = {
> static struct dac_info * ics5342_init(dac_read_regs_t drr, dac_write_regs_t dwr, void *data)
> {
> struct ics5342_info *ics_info = kzalloc_obj(struct ics5342_info);
> - struct dac_info *info = &ics_info->dac;
> + struct dac_info *info;
>
> if (!ics_info)
> return NULL;
>
> + info = &ics_info->dac;
> info->dacops = &ics5342_ops;
> info->dac_read_regs = drr;
> info->dac_write_regs = dwr;
next prev parent reply other threads:[~2026-07-18 18:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 10:18 [PATCH] fbdev: arkfb: Move a variable assignment behind a condition check in ics5342_init() Markus Elfring
2026-07-18 18:17 ` Helge Deller [this message]
2026-07-18 20:34 ` Markus Elfring
2026-07-18 20:59 ` Helge Deller
2026-07-19 6:50 ` Markus Elfring
2026-07-20 9:52 ` Markus Elfring
2026-07-18 21:47 ` Uwe Kleine-König
2026-07-19 7:24 ` Markus Elfring
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=40d5e392-3f99-44c9-b30a-3481f60143ba@gmx.de \
--to=deller@gmx.de \
--cc=Markus.Elfring@web.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=kees@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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