Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2872521ybi; Sun, 28 Jul 2019 19:58:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYKC/j73Pr1geRqh6wV1A2DNDGjkLdm0sMN3+tblRMFbNSGN0qvogIWePBzRud5dnEetFO X-Received: by 2002:a63:fe52:: with SMTP id x18mr101389921pgj.344.1564369101531; Sun, 28 Jul 2019 19:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564369101; cv=none; d=google.com; s=arc-20160816; b=lRhaSJmscFS0G5o+du4qyluAPrOLbM1OeKMa1/BarKOQlRS2eVDD3rLueSAqvM0l8r ssUMTrTDLE/o2H2KH4TPJzXuWzz/ko8J6HFvP90T8uGV76aPaQQvDRFX/XVMsKctEVQD QeyY8T610SDKOuHD88+fdPoJintY74Mzm3VXdNlVdfQMmh4QUEoOTfheasyajuSai5Qh m8FrWCItzAwlgHAu144uNXyzb6huWW2Oiw/11A4zEs7qMVhQVb67CLYTMXRctB95wi7W yF2DEo72uIPfUQvTijUMcjgqMO4NJQ31PpD9bUcwxaUWRypesdlebwEzyjsfT4QWfeMk sMNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=6qgI7wnWwk5AcFrkN5MRgsRXqjtKLh3sBeRYhbw2D90=; b=IDjHiHI5AuKvpAq87eT52KWbRwOYRVUejVRX7at/BaLnNMPwlvjqj0kpZfHqC9shyA 6YcSaoPgXPhYcgAuXNw/D/cMjqDrIPyUh4P+GNau6l4z2j+nPjGKxikitFDGgTmkx1J1 B5vmk94knUW2lpgnwM1hzjIih3IpKXf8auirQVVMcGKo/mSkJd4DN12UgawpHZrpn9qn OndDROJ5TaiLlmVvrgMiAjj+npyQVNrZ94JZ9qmyLOATKqDqOGZJRxMc4IdPB9F+HNWq FO7+E3H42RcTQNo48gtGCcv8JzzRvUfo3/lsnllcNMhhSfbbh9aixsDL2t7lZlCIzp+t oo/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si22790682plz.242.2019.07.28.19.58.06; Sun, 28 Jul 2019 19:58:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726831AbfG2C4V (ORCPT + 99 others); Sun, 28 Jul 2019 22:56:21 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:45452 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726150AbfG2Czj (ORCPT ); Sun, 28 Jul 2019 22:55:39 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 1BCBF55BEEE19EAB9F88; Mon, 29 Jul 2019 10:55:36 +0800 (CST) Received: from localhost.localdomain (10.67.212.132) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Mon, 29 Jul 2019 10:55:28 +0800 From: Huazhong Tan To: CC: , , , , , , Guangbin Huang , "Huazhong Tan" Subject: [PATCH V4 net-next 02/10] net: hns3: add a check for get_reset_level Date: Mon, 29 Jul 2019 10:53:23 +0800 Message-ID: <1564368811-65492-3-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1564368811-65492-1-git-send-email-tanhuazhong@huawei.com> References: <1564368811-65492-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.132] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guangbin Huang For some cases, ops->get_reset_level may not be implemented, so we should check whether it is NULL before calling get_reset_level. Signed-off-by: Guangbin Huang Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 08af782..4d58c53 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -1963,7 +1963,7 @@ static pci_ers_result_t hns3_slot_reset(struct pci_dev *pdev) ops = ae_dev->ops; /* request the reset */ - if (ops->reset_event) { + if (ops->reset_event && ops->get_reset_level) { if (ae_dev->hw_err_reset_req) { reset_type = ops->get_reset_level(ae_dev, &ae_dev->hw_err_reset_req); -- 2.7.4