From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH rdma-next V1 16/17] IB/isert: Remove and fix debug prints after allocation failure
Date: Thu, 3 Nov 2016 16:44:24 +0200 [thread overview]
Message-ID: <1478184265-9620-17-git-send-email-leon@kernel.org> (raw)
In-Reply-To: <1478184265-9620-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
The prints after [k|v][m|z|c]alloc() functions are not needed,
because in case of failure, allocator will print their internal
error prints anyway.
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
drivers/infiniband/ulp/isert/ib_isert.c | 23 ++++++-----------------
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 6dd43f6..225cb82 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -184,7 +184,7 @@ isert_alloc_rx_descriptors(struct isert_conn *isert_conn)
isert_conn->rx_descs = kzalloc(ISERT_QP_MAX_RECV_DTOS *
sizeof(struct iser_rx_desc), GFP_KERNEL);
if (!isert_conn->rx_descs)
- goto fail;
+ return -ENOMEM;
rx_desc = isert_conn->rx_descs;
@@ -213,9 +213,7 @@ isert_alloc_rx_descriptors(struct isert_conn *isert_conn)
}
kfree(isert_conn->rx_descs);
isert_conn->rx_descs = NULL;
-fail:
isert_err("conn %p failed to allocate rx descriptors\n", isert_conn);
-
return -ENOMEM;
}
@@ -269,10 +267,8 @@ isert_alloc_comps(struct isert_device *device)
device->comps = kcalloc(device->comps_used, sizeof(struct isert_comp),
GFP_KERNEL);
- if (!device->comps) {
- isert_err("Unable to allocate completion contexts\n");
+ if (!device->comps)
return -ENOMEM;
- }
max_cqe = min(ISER_MAX_CQ_LEN, device->ib_device->attrs.max_cqe);
@@ -432,10 +428,8 @@ isert_alloc_login_buf(struct isert_conn *isert_conn,
isert_conn->login_req_buf = kzalloc(sizeof(*isert_conn->login_req_buf),
GFP_KERNEL);
- if (!isert_conn->login_req_buf) {
- isert_err("Unable to allocate isert_conn->login_buf\n");
+ if (!isert_conn->login_req_buf)
return -ENOMEM;
- }
isert_conn->login_req_dma = ib_dma_map_single(ib_dev,
isert_conn->login_req_buf,
@@ -1276,11 +1270,8 @@ isert_handle_text_cmd(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd
if (payload_length) {
text_in = kzalloc(payload_length, GFP_KERNEL);
- if (!text_in) {
- isert_err("Unable to allocate text_in of payload_length: %u\n",
- payload_length);
+ if (!text_in)
return -ENOMEM;
- }
}
cmd->text_in_ptr = text_in;
@@ -2307,10 +2298,9 @@ isert_setup_np(struct iscsi_np *np,
int ret;
isert_np = kzalloc(sizeof(struct isert_np), GFP_KERNEL);
- if (!isert_np) {
- isert_err("Unable to allocate struct isert_np\n");
+ if (!isert_np)
return -ENOMEM;
- }
+
sema_init(&isert_np->sem, 0);
mutex_init(&isert_np->mutex);
INIT_LIST_HEAD(&isert_np->accepted);
@@ -2651,7 +2641,6 @@ static int __init isert_init(void)
WQ_UNBOUND | WQ_HIGHPRI, 0);
if (!isert_comp_wq) {
isert_err("Unable to allocate isert_comp_wq\n");
- ret = -ENOMEM;
return -ENOMEM;
}
--
2.7.4
--
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
next prev parent reply other threads:[~2016-11-03 14:44 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-03 14:44 [PATCH rdma-next V1 00/17] Remove debug prints after allocation failure Leon Romanovsky
[not found] ` <1478184265-9620-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-11-03 14:44 ` [PATCH rdma-next V1 01/17] IB/mad: " Leon Romanovsky
[not found] ` <1478184265-9620-2-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-12-16 3:43 ` ira.weiny
2016-11-03 14:44 ` [PATCH rdma-next V1 02/17] IB/core: " Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 03/17] IB/core: Release allocated memory in cache setup failure Leon Romanovsky
[not found] ` <1478184265-9620-4-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-12-16 3:42 ` ira.weiny
[not found] ` <20161216034218.GA12582-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2016-12-16 4:27 ` Jason Gunthorpe
[not found] ` <20161216042743.GD3797-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-12-18 7:41 ` Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 04/17] IB/mlx4: Remove debug prints after allocation failure Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 05/17] IB/mlx5: " Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 06/17] IB/hfi1: " Leon Romanovsky
[not found] ` <1478184265-9620-7-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-11-12 4:04 ` Dalessandro, Dennis
[not found] ` <1478923438.2458.9.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-12-03 18:31 ` Doug Ledford
2016-11-03 14:44 ` [PATCH rdma-next V1 07/17] IB/cxgb3: " Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 08/17] IB/cxgb4: " Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 09/17] IB/i40iw: " Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 10/17] IB/qib: " Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 11/17] IB/nes: " Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 12/17] IB/mthca: " Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 13/17] IB/usninc: Remove and fix " Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 14/17] IB/ocrdma: " Leon Romanovsky
2016-11-03 14:44 ` [PATCH rdma-next V1 15/17] IB/rxe: " Leon Romanovsky
2016-11-03 14:44 ` Leon Romanovsky [this message]
[not found] ` <1478184265-9620-17-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-11-03 21:24 ` [PATCH rdma-next V1 16/17] IB/isert: " Sagi Grimberg
2016-11-03 14:44 ` [PATCH rdma-next V1 17/17] IB/ipoib: " Leon Romanovsky
2016-12-03 18:30 ` [PATCH rdma-next V1 00/17] Remove " Doug Ledford
2016-12-16 4:04 ` ira.weiny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1478184265-9620-17-git-send-email-leon@kernel.org \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).