[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALs4sv3Y4GDhdquNywOtFtkJmKWPGWt+C2hRaAyroRT5t64ARQ@mail.gmail.com>
Date: Mon, 10 Jul 2023 09:42:45 +0530
From: Pavan Chebbi <pavan.chebbi@...adcom.com>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc: andrew@...n.ch, f.fainelli@...il.com, olteanv@...il.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, ansuelsmth@...il.com,
rmk+kernel@...linux.org.uk, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: dsa: qca8k: Add check for skb_copy
On Mon, Jul 10, 2023 at 7:09 AM Jiasheng Jiang <jiasheng@...as.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@...as.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@...adcom.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
>
>
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)
Powered by blists - more mailing lists