Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9030171ybi; Tue, 23 Jul 2019 20:22:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5Km3qM8OISCEcf8FTHlnCT6daR+iq5r0EylOC4P9kuSnqC6NoiC7PYzMGbJrOeKHj3qE7 X-Received: by 2002:a63:b346:: with SMTP id x6mr79643415pgt.218.1563938576122; Tue, 23 Jul 2019 20:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563938576; cv=none; d=google.com; s=arc-20160816; b=jJJTmSoZrqvRG9nlZhv7QdA4MF1S2yI7muhEvznJyaGvaxMn9+w6ekVzSPsCj/QPS5 lOfqDfRZetfrx7m4JBpdHKCkfK3CY+zRActQYECFmgPYtYoPwz6wXKbkFrL0H8m8yG8b QQujt0lr4uBYdMlAk2HYSTF7gdsMOOK9K32I9+hctM8T+Z/P9n0ovxkvF9uvhrmbW6L5 TPgQKcyY9Wqp1zsdMDejBiF+E4YBcD9MOIX6bOUlmokmS9xn0ZBlgtoKdIVEQ04a/1fL AaZUz2mG3+7HjxjPI4trCMHmKnhWdHMUsFqtxkuQdEhbfXtzKJS+JO3JZ5XqvPsWiA+0 hgww== 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=tn27sjk8y+caBYyYdhTCUj/qV0ZJImn8YYlmsEwqdodrAkrpdZ64m6SyVuDmeZOOjN fPkavV43MFaVxnbEa8PMVCMDNp4WF5CJM+CzIUkuAmQWsEukHXeHmalY7ooKFdw8Rj2u 8Wx2dbq0dcyUOWC1wtq69F6C7v/9U8RNryeS8SGt3CnPlO5GQdYK16TPrZiLr2pMSiZG P1v5o3qboMXStPhTRvXKKWEUJQhsINJdKPtdvLptEAktqvKousMonCQyyUziTzlSV3Q8 U18RgFPPw2AU+PSArN7gdpHQ9ElWJGlbmqmUAR6LpZurOEeaSAQVLslbVdroMEylq7v5 9wLQ== 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 n61si12139246pjb.20.2019.07.23.20.22.41; Tue, 23 Jul 2019 20:22:56 -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 S1726741AbfGXDVf (ORCPT + 99 others); Tue, 23 Jul 2019 23:21:35 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:50486 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726380AbfGXDU7 (ORCPT ); Tue, 23 Jul 2019 23:20:59 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6CB35F190550F8821ED4; Wed, 24 Jul 2019 11:20:52 +0800 (CST) Received: from localhost.localdomain (10.67.212.132) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Wed, 24 Jul 2019 11:20:43 +0800 From: Huazhong Tan To: CC: , , , , , Guangbin Huang , Huazhong Tan Subject: [PATCH net-next 02/11] net: hns3: add a check for get_reset_level Date: Wed, 24 Jul 2019 11:18:38 +0800 Message-ID: <1563938327-9865-3-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1563938327-9865-1-git-send-email-tanhuazhong@huawei.com> References: <1563938327-9865-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