* [PATCH net] hinic: fix passing non negative value to ERR_PTR
@ 2020-06-30 6:35 Luo bin
2020-06-30 16:20 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Luo bin @ 2020-06-30 6:35 UTC (permalink / raw)
To: davem
Cc: linux-kernel, netdev, luoxianjun, yin.yinshi, cloud.wangxiaoyun,
chiqijun
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: 7dd29ee12865 ("net-next/hinic: add sriov feature support")
Signed-off-by: Luo bin <luobin9@huawei.com>
---
drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c
index 0245da02efbb..b735bc537508 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c
@@ -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);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] hinic: fix passing non negative value to ERR_PTR
2020-06-30 6:35 [PATCH net] hinic: fix passing non negative value to ERR_PTR Luo bin
@ 2020-06-30 16:20 ` Jakub Kicinski
2020-07-01 2:54 ` luobin (L)
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2020-06-30 16:20 UTC (permalink / raw)
To: Luo bin
Cc: davem, linux-kernel, netdev, luoxianjun, yin.yinshi,
cloud.wangxiaoyun, chiqijun
On Tue, 30 Jun 2020 14:35:54 +0800 Luo bin wrote:
> 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: 7dd29ee12865 ("net-next/hinic: add sriov feature support")
> Signed-off-by: Luo bin <luobin9@huawei.com>
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")'
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] hinic: fix passing non negative value to ERR_PTR
2020-06-30 16:20 ` Jakub Kicinski
@ 2020-07-01 2:54 ` luobin (L)
0 siblings, 0 replies; 3+ messages in thread
From: luobin (L) @ 2020-07-01 2:54 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, linux-kernel, netdev, luoxianjun, yin.yinshi,
cloud.wangxiaoyun, chiqijun
On 2020/7/1 0:20, Jakub Kicinski wrote:
> On Tue, 30 Jun 2020 14:35:54 +0800 Luo bin wrote:
>> 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: 7dd29ee12865 ("net-next/hinic: add sriov feature support")
>> Signed-off-by: Luo bin <luobin9@huawei.com>
>
> 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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-01 2:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-30 6:35 [PATCH net] hinic: fix passing non negative value to ERR_PTR Luo bin
2020-06-30 16:20 ` Jakub Kicinski
2020-07-01 2:54 ` luobin (L)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).