Commit fa17c708 authored by Guangbin Huang's avatar Guangbin Huang Committed by David S. Miller

net: hns3: check NULL pointer before use

This patch checks ops->set_default_reset_request whether is NULL
before using it in function hns3_slot_reset.
Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 96e65abb
...@@ -2006,7 +2006,8 @@ static pci_ers_result_t hns3_slot_reset(struct pci_dev *pdev) ...@@ -2006,7 +2006,8 @@ static pci_ers_result_t hns3_slot_reset(struct pci_dev *pdev)
ops = ae_dev->ops; ops = ae_dev->ops;
/* request the reset */ /* request the reset */
if (ops->reset_event && ops->get_reset_level) { if (ops->reset_event && ops->get_reset_level &&
ops->set_default_reset_request) {
if (ae_dev->hw_err_reset_req) { if (ae_dev->hw_err_reset_req) {
reset_type = ops->get_reset_level(ae_dev, reset_type = ops->get_reset_level(ae_dev,
&ae_dev->hw_err_reset_req); &ae_dev->hw_err_reset_req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment