Re: [PATCH for-next 7/8] RDMA/hns: Refactor the alloc_srqc()

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

 



On 2022/2/24 21:35, Leon Romanovsky wrote:
>> +static int hns_roce_create_srqc(struct hns_roce_dev *hr_dev,
>> +				struct hns_roce_srq *srq)
>> +{
>> +	struct ib_device *ibdev = &hr_dev->ib_dev;
>> +	struct hns_roce_cmd_mailbox *mailbox;
>> +	int ret;
>>  
>>  	mailbox = hns_roce_alloc_cmd_mailbox(hr_dev);
>>  	if (IS_ERR_OR_NULL(mailbox)) {
> hns_roce_alloc_cmd_mailbox() never returns NULL, so the check should be IS_ERR()
> 
> Thanks
> 

There are a few more hns_roce_alloc_cmd_mailbox() return values to deal with.
I will add a new patch in v2.

Thanks,
Wenpeng

>>  		ibdev_err(ibdev, "failed to alloc mailbox for SRQC.\n");
>> -		ret = -ENOMEM;
>> -		goto err_xa;
>> +		return PTR_ERR(mailbox);
>>  	}



[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