[openib-general] [PATCH] ib_mad.c: In ib_mad_post_send, set bad_send_wr on errors
Hal Rosenstock
halr at voltaire.com
Fri Sep 10 14:56:10 PDT 2004
ib_mad.c: In ib_mad_post_send, set bad_send_wr on errors
Index: ib_mad.c
===================================================================
--- ib_mad.c (revision 770)
+++ ib_mad.c (working copy)
@@ -326,9 +326,12 @@
struct ib_mad_send_wr_private *mad_send_wr;
IB_MAD_SEND_LIST_LOCK_VAR;
+ cur_send_wr = send_wr;
/* Validate supplied parameters */
- if (!mad_agent || !send_wr)
+ if (!mad_agent || !send_wr) {
+ *bad_send_wr = cur_send_wr;
return -EINVAL;
+ }
/* Walk list of send WRs and post each one on send list */
cur_send_wr = send_wr;
@@ -338,6 +341,7 @@
/* Allocate MAD send WR tracking structure */
mad_send_wr = kmalloc(sizeof *mad_send_wr, GFP_KERNEL);
if (!mad_send_wr) {
+ *bad_send_wr = cur_send_wr;
printk(KERN_ERR "No memory for ib_mad_send_wr_private\n");
return -ENOMEM;
}
More information about the general
mailing list