Re: [PATCH V3 for-next 1/6] RDMA/hns: Add rq inline data support for hip08 RoCE

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

 



在 2017/12/30 2:18, Jason Gunthorpe 写道:
> On Fri, Dec 29, 2017 at 05:38:56PM +0800, Lijun Ou wrote:
>> +		hr_qp->rq_inl_buf.wqe_list = kcalloc(1, hr_qp->rq.wqe_cnt *
>> +					       sizeof(struct hns_roce_rinl_wqe),
>> +					       GFP_KERNEL);
> 
> This is complete mis-use of the 2d allocator functions. It needs to
> be:
> 
> 	hr_qp->rq_inl_buf.wqe_list = kcalloc(hr_qp->rq.wqe_cnt,
> 					       sizeof(struct hns_roce_rinl_wqe),
> 					       GFP_KERNEL);
> 
> It is important that the first argument be the 'untrsuted' value so
> the multiply overflow checking works properly.
> 
Thanks
>> +		/* Firstly, allocate a list of sge space buffer */
>> +		hr_qp->rq_inl_buf.wqe_list[0].sg_list =
>> +					kcalloc(1, hr_qp->rq_inl_buf.wqe_cnt *
>> +					       init_attr->cap.max_recv_sge *
>> +					       sizeof(struct hns_roce_rinl_sge),
>> +					       GFP_KERNEL);
> 
> ditto
> 
> Jason
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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