Message ID | 20200529100302.GC1304852@mwanda (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | IB/hfi1: Fix an error code in hfi1_vnic_init() | expand |
> From: Dan Carpenter <dan.carpenter@oracle.com> > diff --git a/drivers/infiniband/hw/hfi1/vnic_main.c > b/drivers/infiniband/hw/hfi1/vnic_main.c > index b183c56b7b6a4..f89d0cb1c7204 100644 > --- a/drivers/infiniband/hw/hfi1/vnic_main.c > +++ b/drivers/infiniband/hw/hfi1/vnic_main.c > @@ -512,7 +512,8 @@ static int hfi1_vnic_init(struct hfi1_vnic_vport_info > *vinfo) > goto txreq_fail; > } > > - if (hfi1_netdev_rx_init(dd)) { > + rc = hfi1_netdev_rx_init(dd); > + if (rc) { > dd_dev_err(dd, "Unable to initialize netdev contexts\n"); > goto alloc_fail; > } Dan, This is definitely wrong, but another call to hfi1_netdev_rx_init() exists in hfi1_vnic_up() that needs to be fixed. Can you address that too? Mike
diff --git a/drivers/infiniband/hw/hfi1/vnic_main.c b/drivers/infiniband/hw/hfi1/vnic_main.c index b183c56b7b6a4..f89d0cb1c7204 100644 --- a/drivers/infiniband/hw/hfi1/vnic_main.c +++ b/drivers/infiniband/hw/hfi1/vnic_main.c @@ -512,7 +512,8 @@ static int hfi1_vnic_init(struct hfi1_vnic_vport_info *vinfo) goto txreq_fail; } - if (hfi1_netdev_rx_init(dd)) { + rc = hfi1_netdev_rx_init(dd); + if (rc) { dd_dev_err(dd, "Unable to initialize netdev contexts\n"); goto alloc_fail; }
We should preserve the error code from hfi1_netdev_rx_init() but currently the function returns success instead. Fixes: 2280740f01ae ("IB/hfi1: Virtual Network Interface Controller (VNIC) HW support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/infiniband/hw/hfi1/vnic_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)