netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavan Chebbi <pavan.chebbi@broadcom.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com,
	 davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com,  ansuelsmth@gmail.com,
	rmk+kernel@armlinux.org.uk, netdev@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: dsa: qca8k: Add check for skb_copy
Date: Mon, 10 Jul 2023 09:42:45 +0530	[thread overview]
Message-ID: <CALs4sv3Y4GDhdquNywOtFtkJmKWPGWt+C2hRaAyroRT5t64ARQ@mail.gmail.com> (raw)
In-Reply-To: <20230710013907.43770-1-jiasheng@iscas.ac.cn>

[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]

On Mon, Jul 10, 2023 at 7:09 AM Jiasheng Jiang <jiasheng@iscas.ac.cn> wrote:
>
> Add check for the return value of skb_copy in order to avoid NULL pointer
> dereference.
>
> Fixes: 2cd548566384 ("net: dsa: qca8k: add support for phy read/write with mgmt Ethernet")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
>  drivers/net/dsa/qca/qca8k-8xxx.c | 3 +++
>  1 file changed, 3 insertions(+)
>

Looks good to me.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>

> diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
> index f7d7cfb2fd86..09b80644c11b 100644
> --- a/drivers/net/dsa/qca/qca8k-8xxx.c
> +++ b/drivers/net/dsa/qca/qca8k-8xxx.c
> @@ -588,6 +588,9 @@ qca8k_phy_eth_busy_wait(struct qca8k_mgmt_eth_data *mgmt_eth_data,
>         bool ack;
>         int ret;
>
> +       if (!skb)
> +               return -ENOMEM;
> +
>         reinit_completion(&mgmt_eth_data->rw_done);
>
>         /* Increment seq_num and set it in the copy pkt */
> --
> 2.25.1
>
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

  reply	other threads:[~2023-07-10  4:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10  1:39 [PATCH] net: dsa: qca8k: Add check for skb_copy Jiasheng Jiang
2023-07-10  4:12 ` Pavan Chebbi [this message]
2023-07-10  7:30 ` patchwork-bot+netdevbpf

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=CALs4sv3Y4GDhdquNywOtFtkJmKWPGWt+C2hRaAyroRT5t64ARQ@mail.gmail.com \
    --to=pavan.chebbi@broadcom.com \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=jiasheng@iscas.ac.cn \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).