From: YANG LI <abaci-bug...@linux.alibaba.com>

[ Upstream commit 862aecbd9569e563b979c0e23a908b43cda4b0b9 ]

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.

Fixes: 9281cf2d5840 ("ibmvnic: avoid memset null scrq msgs")
Signed-off-by: YANG LI <abaci-bug...@linux.alibaba.com>
Reported-by: Abaci <ab...@linux.alibaba.com>
Acked-by: Lijun Pan <l...@linux.ibm.com>
Link: 
https://lore.kernel.org/r/1609312994-121032-1-git-send-email-abaci-bug...@linux.alibaba.com
Signed-off-by: Jakub Kicinski <k...@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/net/ethernet/ibm/ibmvnic.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2869,9 +2869,7 @@ static int reset_one_sub_crq_queue(struc
        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;
        }
 


Reply via email to