Commit d3c54f7f authored by Luo bin's avatar Luo bin Committed by David S. Miller
Browse files

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: default avatarLuo bin <luobin9@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8ff41cc2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -814,6 +814,8 @@ err_aeqs_init:
err_init_msix:
err_pfhwdev_alloc:
	hinic_free_hwif(hwif);
	if (err > 0)
		err = -EIO;
	return ERR_PTR(err);
}