[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201230134806.GN6564@kitsune.suse.cz>
Date: Wed, 30 Dec 2020 14:48:06 +0100
From: Michal Suchánek <msuchanek@...e.de>
To: YANG LI <abaci-bugfix@...ux.alibaba.com>
Cc: davem@...emloft.net, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, ljp@...ux.ibm.com, drt@...ux.ibm.com,
kuba@...nel.org, sukadev@...ux.ibm.com,
linuxppc-dev@...ts.ozlabs.org, paulus@...ba.org
Subject: Re: [PATCH] ibmvnic: fix: NULL pointer dereference.
On Wed, Dec 30, 2020 at 03:23:14PM +0800, YANG LI wrote:
> The error is due to dereference a null pointer in function
> reset_one_sub_crq_queue():
>
> if (!scrq) {
> netdev_dbg(adapter->netdev,
> "Invalid scrq reset. irq (%d) or msgs(%p).\n",
> scrq->irq, scrq->msgs);
> return -EINVAL;
> }
>
> If the expression is true, scrq must be a null pointer and cannot
> dereference.
>
> Signed-off-by: YANG LI <abaci-bugfix@...ux.alibaba.com>
> Reported-by: Abaci <abaci@...ux.alibaba.com>
Fixes: 9281cf2d5840 ("ibmvnic: avoid memset null scrq msgs")
> ---
> drivers/net/ethernet/ibm/ibmvnic.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
> index f302504..d7472be 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -2981,9 +2981,7 @@ static int reset_one_sub_crq_queue(struct ibmvnic_adapter *adapter,
> int rc;
>
> if (!scrq) {
> - netdev_dbg(adapter->netdev,
> - "Invalid scrq reset. irq (%d) or msgs (%p).\n",
> - scrq->irq, scrq->msgs);
> + netdev_dbg(adapter->netdev, "Invalid scrq reset.\n");
> return -EINVAL;
> }
>
> --
> 1.8.3.1
>
Powered by blists - more mailing lists