Fix missing kfree in pvrdma_register_device() when fails
to do ib_device_set_netdev.
Fixes: 4b38da75e089 ("RDMA/drivers: Convert easy drivers to use ib_device_set_netdev()")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Qinglang Miao <[email protected]>
---
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
index fa2a3fa0c3e4..f71d99946bed 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
@@ -266,7 +266,7 @@ static int pvrdma_register_device(struct pvrdma_dev *dev)
}
ret = ib_device_set_netdev(&dev->ib_dev, dev->netdev, 1);
if (ret)
- return ret;
+ goto err_qp_free;
spin_lock_init(&dev->srq_tbl_lock);
rdma_set_device_sysfs_group(&dev->ib_dev, &pvrdma_attr_group);
--
2.23.0
On 11/10/20 7:22 PM, Qinglang Miao wrote:
> Fix missing kfree in pvrdma_register_device() when fails
> to do ib_device_set_netdev.
>
> Fixes: 4b38da75e089 ("RDMA/drivers: Convert easy drivers to use ib_device_set_netdev()")
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Qinglang Miao <[email protected]>
> ---
> drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
> index fa2a3fa0c3e4..f71d99946bed 100644
> --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
> +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
> @@ -266,7 +266,7 @@ static int pvrdma_register_device(struct pvrdma_dev *dev)
> }
> ret = ib_device_set_netdev(&dev->ib_dev, dev->netdev, 1);
> if (ret)
> - return ret;
> + goto err_qp_free;
Thanks. This should be 'goto err_srq_free'.
> spin_lock_init(&dev->srq_tbl_lock);
> rdma_set_device_sysfs_group(&dev->ib_dev, &pvrdma_attr_group);
>
>
On Wed, Nov 11, 2020 at 11:22:02AM +0800, Qinglang Miao wrote:
> Fix missing kfree in pvrdma_register_device() when fails
> to do ib_device_set_netdev.
>
> Fixes: 4b38da75e089 ("RDMA/drivers: Convert easy drivers to use ib_device_set_netdev()")
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Qinglang Miao <[email protected]>
> ---
> drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to for-rc with the 'goto err_srq_free' from Adit
Thanks,
Jason