提交 d3c54f7f 编写于 作者: L Luo bin 提交者: David S. Miller

hinic: fix passing non negative value to ERR_PTR

get_dev_cap and set_resources_state functions may return a positive
value because of hardware failure, and the positive return value
can not be passed to ERR_PTR directly.

Fixes: 7dd29ee1 ("hinic: add sriov feature support")
Signed-off-by: NLuo bin <luobin9@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8ff41cc2
......@@ -814,6 +814,8 @@ struct hinic_hwdev *hinic_init_hwdev(struct pci_dev *pdev)
err_init_msix:
err_pfhwdev_alloc:
hinic_free_hwif(hwif);
if (err > 0)
err = -EIO;
return ERR_PTR(err);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册