Re: [PATCH rdma-next v3 19/19] RDMA: Provide safe ib_alloc_device() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 30, 2019 at 12:49:11PM +0200, Leon Romanovsky wrote:

> diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
> index 4c32aa852fc2..9b4def5b48fa 100644
> +++ b/drivers/infiniband/sw/rdmavt/vt.c
> @@ -91,7 +91,7 @@ struct rvt_dev_info *rvt_alloc_device(size_t size, int nports)
>  {
>  	struct rvt_dev_info *rdi;
>  
> -	rdi = (struct rvt_dev_info *)ib_alloc_device(size);
> +	rdi = (struct rvt_dev_info *)_ib_alloc_device(size);

This should be container_of:

+       rdi = container_of(_ib_alloc_device(size), struct rvt_dev_info, ibdev);

I fixed it and applied to for-next

I have some mixed feelings about this, CH is fairly right that this is
not the standard pattern, but it is so well established in the drivers
that I don't see any point in painfully trying to rip it out and
switch to some dedicated opaque priv like net uses.

So lets support it more robustly and go ahead with this..

Thanks,
Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux