The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Alper Ak <alperyasinak1@gmail.com>, peda@axentia.se
Cc: Andrew Davis <afd@ti.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Thomas Richard (TI.com)" <thomas.richard@bootlin.com>,
	Thorsten Blum <thorsten.blum@linux.dev>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmux: mmio: fix IS_ERR() vs NULL check for mux_mmio_probe()
Date: Thu, 25 Dec 2025 13:08:07 +0100	[thread overview]
Message-ID: <5e5d1d25-2e03-43fa-bbc6-8256f31a1000@kernel.org> (raw)
In-Reply-To: <20251225114102.337593-1-alperyasinak1@gmail.com>

On 25/12/2025 12:41, Alper Ak wrote:
> devm_kmalloc() returns NULL on failure, not an ERR_PTR value. The
> current IS_ERR() check will never catch allocation failures, which
> could lead to NULL pointer dereference.
> 
> Signed-off-by: Alper Ak <alperyasinak1@gmail.com>

Missing fixes tag.

> ---
>  drivers/mux/mmio.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mux/mmio.c b/drivers/mux/mmio.c
> index e4ddb1e61923..3409af1ffb80 100644
> --- a/drivers/mux/mmio.c
> +++ b/drivers/mux/mmio.c
> @@ -101,13 +101,13 @@ static int mux_mmio_probe(struct platform_device *pdev)
>  	mux_mmio = mux_chip_priv(mux_chip);
>  
>  	mux_mmio->fields = devm_kmalloc(dev, num_fields * sizeof(*mux_mmio->fields), GFP_KERNEL);
> -	if (IS_ERR(mux_mmio->fields))
> -		return PTR_ERR(mux_mmio->fields);

I really wonder from where do the people sometimes copy code...

With missing tag:

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof

  reply	other threads:[~2025-12-25 12:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-25 11:41 [PATCH] mmux: mmio: fix IS_ERR() vs NULL check for mux_mmio_probe() Alper Ak
2025-12-25 12:08 ` Krzysztof Kozlowski [this message]
2025-12-25 12:48   ` [PATCH v2] mux: " Alper Ak

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=5e5d1d25-2e03-43fa-bbc6-8256f31a1000@kernel.org \
    --to=krzk@kernel.org \
    --cc=afd@ti.com \
    --cc=alperyasinak1@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peda@axentia.se \
    --cc=thomas.richard@bootlin.com \
    --cc=thorsten.blum@linux.dev \
    /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