From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A138C433E6 for ; Wed, 30 Dec 2020 13:49:55 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D446820791 for ; Wed, 30 Dec 2020 13:49:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D446820791 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4D5Xhw68ZMzDqBH for ; Thu, 31 Dec 2020 00:49:52 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=195.135.220.15; helo=mx2.suse.de; envelope-from=msuchanek@suse.de; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4D5Xg23CxwzDqKL for ; Thu, 31 Dec 2020 00:48:13 +1100 (AEDT) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 0DC0DABA1; Wed, 30 Dec 2020 13:48:08 +0000 (UTC) Date: Wed, 30 Dec 2020 14:48:06 +0100 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: YANG LI Subject: Re: [PATCH] ibmvnic: fix: NULL pointer dereference. Message-ID: <20201230134806.GN6564@kitsune.suse.cz> References: <1609312994-121032-1-git-send-email-abaci-bugfix@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1609312994-121032-1-git-send-email-abaci-bugfix@linux.alibaba.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ljp@linux.ibm.com, drt@linux.ibm.com, kuba@kernel.org, sukadev@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, davem@davemloft.net, paulus@samba.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 > Reported-by: Abaci 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 >