Commit 27162432 authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Doug Ledford

IB/mad: Remove debug prints after allocation failure

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: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent e37a79e5
...@@ -816,7 +816,6 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv, ...@@ -816,7 +816,6 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
local = kmalloc(sizeof *local, GFP_ATOMIC); local = kmalloc(sizeof *local, GFP_ATOMIC);
if (!local) { if (!local) {
ret = -ENOMEM; ret = -ENOMEM;
dev_err(&device->dev, "No memory for ib_mad_local_private\n");
goto out; goto out;
} }
local->mad_priv = NULL; local->mad_priv = NULL;
...@@ -824,7 +823,6 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv, ...@@ -824,7 +823,6 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
mad_priv = alloc_mad_private(mad_size, GFP_ATOMIC); mad_priv = alloc_mad_private(mad_size, GFP_ATOMIC);
if (!mad_priv) { if (!mad_priv) {
ret = -ENOMEM; ret = -ENOMEM;
dev_err(&device->dev, "No memory for local response MAD\n");
kfree(local); kfree(local);
goto out; goto out;
} }
...@@ -947,9 +945,6 @@ static int alloc_send_rmpp_list(struct ib_mad_send_wr_private *send_wr, ...@@ -947,9 +945,6 @@ static int alloc_send_rmpp_list(struct ib_mad_send_wr_private *send_wr,
for (left = send_buf->data_len + pad; left > 0; left -= seg_size) { for (left = send_buf->data_len + pad; left > 0; left -= seg_size) {
seg = kmalloc(sizeof (*seg) + seg_size, gfp_mask); seg = kmalloc(sizeof (*seg) + seg_size, gfp_mask);
if (!seg) { if (!seg) {
dev_err(&send_buf->mad_agent->device->dev,
"alloc_send_rmpp_segs: RMPP mem alloc failed for len %zd, gfp %#x\n",
sizeof (*seg) + seg_size, gfp_mask);
free_send_rmpp_list(send_wr); free_send_rmpp_list(send_wr);
return -ENOMEM; return -ENOMEM;
} }
...@@ -1362,12 +1357,7 @@ static int allocate_method_table(struct ib_mad_mgmt_method_table **method) ...@@ -1362,12 +1357,7 @@ static int allocate_method_table(struct ib_mad_mgmt_method_table **method)
{ {
/* Allocate management method table */ /* Allocate management method table */
*method = kzalloc(sizeof **method, GFP_ATOMIC); *method = kzalloc(sizeof **method, GFP_ATOMIC);
if (!*method) { return (*method) ? 0 : (-ENOMEM);
pr_err("No memory for ib_mad_mgmt_method_table\n");
return -ENOMEM;
}
return 0;
} }
/* /*
...@@ -1458,8 +1448,6 @@ static int add_nonoui_reg_req(struct ib_mad_reg_req *mad_reg_req, ...@@ -1458,8 +1448,6 @@ static int add_nonoui_reg_req(struct ib_mad_reg_req *mad_reg_req,
/* Allocate management class table for "new" class version */ /* Allocate management class table for "new" class version */
*class = kzalloc(sizeof **class, GFP_ATOMIC); *class = kzalloc(sizeof **class, GFP_ATOMIC);
if (!*class) { if (!*class) {
dev_err(&agent_priv->agent.device->dev,
"No memory for ib_mad_mgmt_class_table\n");
ret = -ENOMEM; ret = -ENOMEM;
goto error1; goto error1;
} }
...@@ -1524,22 +1512,16 @@ static int add_oui_reg_req(struct ib_mad_reg_req *mad_reg_req, ...@@ -1524,22 +1512,16 @@ static int add_oui_reg_req(struct ib_mad_reg_req *mad_reg_req,
if (!*vendor_table) { if (!*vendor_table) {
/* Allocate mgmt vendor class table for "new" class version */ /* Allocate mgmt vendor class table for "new" class version */
vendor = kzalloc(sizeof *vendor, GFP_ATOMIC); vendor = kzalloc(sizeof *vendor, GFP_ATOMIC);
if (!vendor) { if (!vendor)
dev_err(&agent_priv->agent.device->dev,
"No memory for ib_mad_mgmt_vendor_class_table\n");
goto error1; goto error1;
}
*vendor_table = vendor; *vendor_table = vendor;
} }
if (!(*vendor_table)->vendor_class[vclass]) { if (!(*vendor_table)->vendor_class[vclass]) {
/* Allocate table for this management vendor class */ /* Allocate table for this management vendor class */
vendor_class = kzalloc(sizeof *vendor_class, GFP_ATOMIC); vendor_class = kzalloc(sizeof *vendor_class, GFP_ATOMIC);
if (!vendor_class) { if (!vendor_class)
dev_err(&agent_priv->agent.device->dev,
"No memory for ib_mad_mgmt_vendor_class\n");
goto error2; goto error2;
}
(*vendor_table)->vendor_class[vclass] = vendor_class; (*vendor_table)->vendor_class[vclass] = vendor_class;
} }
...@@ -2238,11 +2220,8 @@ static void ib_mad_recv_done(struct ib_cq *cq, struct ib_wc *wc) ...@@ -2238,11 +2220,8 @@ static void ib_mad_recv_done(struct ib_cq *cq, struct ib_wc *wc)
mad_size = recv->mad_size; mad_size = recv->mad_size;
response = alloc_mad_private(mad_size, GFP_KERNEL); response = alloc_mad_private(mad_size, GFP_KERNEL);
if (!response) { if (!response)
dev_err(&port_priv->device->dev,
"%s: no memory for response buffer\n", __func__);
goto out; goto out;
}
if (rdma_cap_ib_switch(port_priv->device)) if (rdma_cap_ib_switch(port_priv->device))
port_num = wc->port_num; port_num = wc->port_num;
...@@ -2869,8 +2848,6 @@ static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info, ...@@ -2869,8 +2848,6 @@ static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info,
mad_priv = alloc_mad_private(port_mad_size(qp_info->port_priv), mad_priv = alloc_mad_private(port_mad_size(qp_info->port_priv),
GFP_ATOMIC); GFP_ATOMIC);
if (!mad_priv) { if (!mad_priv) {
dev_err(&qp_info->port_priv->device->dev,
"No memory for receive buffer\n");
ret = -ENOMEM; ret = -ENOMEM;
break; break;
} }
...@@ -2961,11 +2938,8 @@ static int ib_mad_port_start(struct ib_mad_port_private *port_priv) ...@@ -2961,11 +2938,8 @@ static int ib_mad_port_start(struct ib_mad_port_private *port_priv)
u16 pkey_index; u16 pkey_index;
attr = kmalloc(sizeof *attr, GFP_KERNEL); attr = kmalloc(sizeof *attr, GFP_KERNEL);
if (!attr) { if (!attr)
dev_err(&port_priv->device->dev,
"Couldn't kmalloc ib_qp_attr\n");
return -ENOMEM; return -ENOMEM;
}
ret = ib_find_pkey(port_priv->device, port_priv->port_num, ret = ib_find_pkey(port_priv->device, port_priv->port_num,
IB_DEFAULT_PKEY_FULL, &pkey_index); IB_DEFAULT_PKEY_FULL, &pkey_index);
...@@ -3135,10 +3109,8 @@ static int ib_mad_port_open(struct ib_device *device, ...@@ -3135,10 +3109,8 @@ static int ib_mad_port_open(struct ib_device *device,
/* Create new device info */ /* Create new device info */
port_priv = kzalloc(sizeof *port_priv, GFP_KERNEL); port_priv = kzalloc(sizeof *port_priv, GFP_KERNEL);
if (!port_priv) { if (!port_priv)
dev_err(&device->dev, "No memory for ib_mad_port_private\n");
return -ENOMEM; return -ENOMEM;
}
port_priv->device = device; port_priv->device = device;
port_priv->port_num = port_num; port_priv->port_num = port_num;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment