hinic: fix passing non negative value to ERR_PTR
Subsystems (3)
PATCH 1/1 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.
--- drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c +2 -0
@@ -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); }
Signature · 1 line
2.17.1
Jakub Kicinski
maintainerQuoted 6 lines · On Tue, 30 Jun 2020 14:35:54 +0800 Luo bin wrote:
get_dev_capandset_resources_statefunctions may return a positive value because of hardware failure, and the positive return value can not be passed toERR_PTRdirectly.Fixes 7dd29ee12865 ("net-next/hinic: add sriov feature support")Signed-off-by Luo bin <[email protected]>
Fixes tag: Fixes: 7dd29ee12865 ("net-next/hinic: add sriov feature support") Has these problem(s):
- Subject does not match target commit subject
Just use
git log -1 --format='Fixes: %h ("%s")'Quoted 8 lines · Jakub Kicinski
Quoted 6 lines · On Tue, 30 Jun 2020 14:35:54 +0800 Luo bin wrote:
get_dev_capandset_resources_statefunctions may return a positive value because of hardware failure, and the positive return value can not be passed toERR_PTRdirectly.Fixes 7dd29ee12865 ("net-next/hinic: add sriov feature support")Signed-off-by Luo bin <[email protected]>
Quoted 7 lines
Fixes tag: Fixes:
7dd29ee12865("net-next/hinic: add sriov feature support") Has these problem(s):- Subject does not match target commit subject Just use git log -1 --format='Fixes: %h ("%s")'.
Will fix. Thanks.