mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Ekaterina Esina <eesina@astralinux.ru>, Zhao Qiang <qiang.zhao@nxp.com>
Cc: "lvc-project@linuxtesting.org" <lvc-project@linuxtesting.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH] net-wan: Add check for NULL for utdm in ucc_hdlc_probe
Date: Mon, 9 Jan 2023 15:49:23 +0000	[thread overview]
Message-ID: <1b6326fa-69b3-0ef0-2927-60f6fbd6ce28@csgroup.eu> (raw)
In-Reply-To: <20221223143225.23153-1-eesina@astralinux.ru>



Le 23/12/2022 à 15:32, Ekaterina Esina a écrit :
> [Vous ne recevez pas souvent de courriers de eesina@astralinux.ru. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> If uhdlc_priv_tsa != 1 then utdm is not initialized.
> And if ret != NULL then goto undo_uhdlc_init, where utdm is dereferenced.
> Same if dev == NULL.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Signed-off-by: Ekaterina Esina <eesina@astralinux.ru>
> ---
>   drivers/net/wan/fsl_ucc_hdlc.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
> index 22edea6ca4b8..2ddb0f71e648 100644
> --- a/drivers/net/wan/fsl_ucc_hdlc.c
> +++ b/drivers/net/wan/fsl_ucc_hdlc.c
> @@ -1243,7 +1243,9 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
>   free_dev:
>          free_netdev(dev);
>   undo_uhdlc_init:
> -       iounmap(utdm->siram);
> +       if (utdm != NULL) {
> +               iounmap(utdm->siram);
> +       }

If utdm being NULL is a problem here, isn't it also a problem in the 
iounmap below ?


>   unmap_si_regs:
>          iounmap(utdm->si_regs);
>   free_utdm:
> --
> 2.30.2
> 

      parent reply	other threads:[~2023-01-09 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-23 14:32 Ekaterina Esina
2022-12-23 15:30 ` [lvc-project] " Alexey Khoroshilov
2023-01-09 15:49 ` Christophe Leroy [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=1b6326fa-69b3-0ef0-2927-60f6fbd6ce28@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eesina@astralinux.ru \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qiang.zhao@nxp.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

all inboxes | Powered by JetHome®