Re: [PATCH -next] iser-target: fix error return code in isert_connect_request()

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

 



On Fri, 2013-04-19 at 13:13 +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
> ---

Merged into the initial iser-target commit in for-next-merge.

Thanks Wei!

--nab

>  drivers/infiniband/ulp/isert/ib_isert.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
> index f6f4f58..803b949 100644
> --- a/drivers/infiniband/ulp/isert/ib_isert.c
> +++ b/drivers/infiniband/ulp/isert/ib_isert.c
> @@ -329,6 +329,7 @@ static struct isert_device *
>  isert_device_find_by_ib_dev(struct rdma_cm_id *cma_id)
>  {
>  	struct isert_device *device;
> +	int ret;
>  
>  	mutex_lock(&device_list_mutex);
>  	list_for_each_entry(device, &device_list, dev_node) {
> @@ -342,16 +343,17 @@ isert_device_find_by_ib_dev(struct rdma_cm_id *cma_id)
>  	device = kzalloc(sizeof(struct isert_device), GFP_KERNEL);
>  	if (!device) {
>  		mutex_unlock(&device_list_mutex);
> -		return NULL;
> +		return ERR_PTR(-ENOMEM);
>  	}
>  
>  	INIT_LIST_HEAD(&device->dev_node);
>  
>  	device->ib_device = cma_id->device;
> -	if (isert_create_device_ib_res(device)) {
> +	ret = isert_create_device_ib_res(device);
> +	if (ret) {
>  		kfree(device);
>  		mutex_unlock(&device_list_mutex);
> -		return NULL;
> +		return ERR_PTR(ret);
>  	}
>  
>  	device->refcount++;
> @@ -434,8 +436,10 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
>  	}
>  
>  	device = isert_device_find_by_ib_dev(cma_id);
> -	if (!device)
> +	if (IS_ERR(device)) {
> +		ret = PTR_ERR(device);
>  		goto out_rsp_dma_map;
> +	}
>  
>  	isert_conn->conn_device = device;
>  	isert_conn->conn_pd = device->dev_pd;
> 


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




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux