All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iser-target: Fix error return code in isert_alloc_login_buf()
@ 2016-08-05 13:49 Wei Yongjun
  2016-08-05 14:36 ` Leon Romanovsky
       [not found] ` <1470404968-17339-1-git-send-email-weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Wei Yongjun @ 2016-08-05 13:49 UTC (permalink / raw)
  To: Sagi Grimberg, Doug Ledford, Sean Hefty, Hal Rosenstock
  Cc: Wei Yongjun, linux-rdma, target-devel

Fix to return error code -ENOMEM from the alloc error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index ba6be06..65af523 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -449,6 +449,7 @@ isert_alloc_login_buf(struct isert_conn *isert_conn,
 	isert_conn->login_rsp_buf = kzalloc(ISER_RX_PAYLOAD_SIZE, GFP_KERNEL);
 	if (!isert_conn->login_rsp_buf) {
 		isert_err("Unable to allocate isert_conn->login_rspbuf\n");
+		ret = -ENOMEM;
 		goto out_unmap_login_req_buf;
 	}

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] iser-target: Fix error return code in isert_alloc_login_buf()
  2016-08-05 13:49 [PATCH] iser-target: Fix error return code in isert_alloc_login_buf() Wei Yongjun
@ 2016-08-05 14:36 ` Leon Romanovsky
       [not found]   ` <20160805143609.GM27667-2ukJVAZIZ/Y@public.gmane.org>
       [not found] ` <1470404968-17339-1-git-send-email-weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Leon Romanovsky @ 2016-08-05 14:36 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Sagi Grimberg, Doug Ledford, Sean Hefty, Hal Rosenstock,
	linux-rdma, target-devel

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

On Fri, Aug 05, 2016 at 01:49:28PM +0000, Wei Yongjun wrote:
> Fix to return error code -ENOMEM from the alloc error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
> ---
>  drivers/infiniband/ulp/isert/ib_isert.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
> index ba6be06..65af523 100644
> --- a/drivers/infiniband/ulp/isert/ib_isert.c
> +++ b/drivers/infiniband/ulp/isert/ib_isert.c
> @@ -449,6 +449,7 @@ isert_alloc_login_buf(struct isert_conn *isert_conn,
>  	isert_conn->login_rsp_buf = kzalloc(ISER_RX_PAYLOAD_SIZE, GFP_KERNEL);
>  	if (!isert_conn->login_rsp_buf) {
>  		isert_err("Unable to allocate isert_conn->login_rspbuf\n");

Please remove the line above too.
There is no chance to miss kzalloc allocation failure.

> +		ret = -ENOMEM;
>  		goto out_unmap_login_req_buf;
>  	}

Thanks.

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iser-target: Fix error return code in isert_alloc_login_buf()
       [not found]   ` <20160805143609.GM27667-2ukJVAZIZ/Y@public.gmane.org>
@ 2016-08-07  9:17     ` Sagi Grimberg
  0 siblings, 0 replies; 6+ messages in thread
From: Sagi Grimberg @ 2016-08-07  9:17 UTC (permalink / raw)
  To: Leon Romanovsky, Wei Yongjun
  Cc: Doug Ledford, Sean Hefty, Hal Rosenstock,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA


>> Fix to return error code -ENOMEM from the alloc error handling
>> case instead of 0, as done elsewhere in this function.
>>
>> Signed-off-by: Wei Yongjun <weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>>  drivers/infiniband/ulp/isert/ib_isert.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
>> index ba6be06..65af523 100644
>> --- a/drivers/infiniband/ulp/isert/ib_isert.c
>> +++ b/drivers/infiniband/ulp/isert/ib_isert.c
>> @@ -449,6 +449,7 @@ isert_alloc_login_buf(struct isert_conn *isert_conn,
>>  	isert_conn->login_rsp_buf = kzalloc(ISER_RX_PAYLOAD_SIZE, GFP_KERNEL);
>>  	if (!isert_conn->login_rsp_buf) {
>>  		isert_err("Unable to allocate isert_conn->login_rspbuf\n");
>
> Please remove the line above too.
> There is no chance to miss kzalloc allocation failure.

With Leon's comment you can add my:

Acked-by: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] iser-target: fix error return code in isert_alloc_login_buf()
       [not found] ` <1470404968-17339-1-git-send-email-weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-08-07 12:20   ` Wei Yongjun
  2016-08-07 13:08     ` Leon Romanovsky
  0 siblings, 1 reply; 6+ messages in thread
From: Wei Yongjun @ 2016-08-07 12:20 UTC (permalink / raw)
  To: Sagi Grimberg, Doug Ledford, Sean Hefty, Hal Rosenstock, Leon Romanovsky
  Cc: Wei Yongjun, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	target-devel-u79uwXL29TY76Z2rM5mHXA

Fix to return error code -ENOMEM from the alloc error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Acked-by: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
---
v1 -> v2: fix with Leon's comment
---
 drivers/infiniband/ulp/isert/ib_isert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index ba6be06..7914c14 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -448,7 +448,7 @@ isert_alloc_login_buf(struct isert_conn *isert_conn,
 
 	isert_conn->login_rsp_buf = kzalloc(ISER_RX_PAYLOAD_SIZE, GFP_KERNEL);
 	if (!isert_conn->login_rsp_buf) {
-		isert_err("Unable to allocate isert_conn->login_rspbuf\n");
+		ret = -ENOMEM;
 		goto out_unmap_login_req_buf;
 	}

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] iser-target: fix error return code in isert_alloc_login_buf()
  2016-08-07 12:20   ` [PATCH v2] iser-target: fix " Wei Yongjun
@ 2016-08-07 13:08     ` Leon Romanovsky
  2016-08-22 18:11       ` Doug Ledford
  0 siblings, 1 reply; 6+ messages in thread
From: Leon Romanovsky @ 2016-08-07 13:08 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Sagi Grimberg, Doug Ledford, Sean Hefty, Hal Rosenstock,
	linux-rdma, target-devel

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

On Sun, Aug 07, 2016 at 12:20:38PM +0000, Wei Yongjun wrote:
> Fix to return error code -ENOMEM from the alloc error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
> Acked-by: Sagi Grimberg <sagi@grimberg.me>
> ---
> v1 -> v2: fix with Leon's comment
> ---
>  drivers/infiniband/ulp/isert/ib_isert.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] iser-target: fix error return code in isert_alloc_login_buf()
  2016-08-07 13:08     ` Leon Romanovsky
@ 2016-08-22 18:11       ` Doug Ledford
  0 siblings, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2016-08-22 18:11 UTC (permalink / raw)
  To: Leon Romanovsky, Wei Yongjun
  Cc: Sagi Grimberg, Sean Hefty, Hal Rosenstock, linux-rdma, target-devel


[-- Attachment #1.1: Type: text/plain, Size: 659 bytes --]

On 8/7/2016 9:08 AM, Leon Romanovsky wrote:
> On Sun, Aug 07, 2016 at 12:20:38PM +0000, Wei Yongjun wrote:
>> Fix to return error code -ENOMEM from the alloc error handling
>> case instead of 0, as done elsewhere in this function.
>>
>> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
>> Acked-by: Sagi Grimberg <sagi@grimberg.me>
>> ---
>> v1 -> v2: fix with Leon's comment
>> ---
>>  drivers/infiniband/ulp/isert/ib_isert.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Thanks,
> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
> 

Thanks, applied.

-- 
Doug Ledford <dledford@redhat.com>
    GPG Key ID: 0E572FDD


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-08-22 18:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-05 13:49 [PATCH] iser-target: Fix error return code in isert_alloc_login_buf() Wei Yongjun
2016-08-05 14:36 ` Leon Romanovsky
     [not found]   ` <20160805143609.GM27667-2ukJVAZIZ/Y@public.gmane.org>
2016-08-07  9:17     ` Sagi Grimberg
     [not found] ` <1470404968-17339-1-git-send-email-weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-08-07 12:20   ` [PATCH v2] iser-target: fix " Wei Yongjun
2016-08-07 13:08     ` Leon Romanovsky
2016-08-22 18:11       ` Doug Ledford

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.