[openib-general] [PATCH] ib_mad.c: Make error return codes are negative
Hal Rosenstock
halr at voltaire.com
Fri Sep 10 15:35:31 PDT 2004
ib_mad.c: Make error return codes are negative
Index: ib_mad.c
===================================================================
--- ib_mad.c (revision 772)
+++ ib_mad.c (working copy)
@@ -403,7 +403,7 @@
i = find_next_bit(mad_reg_req->method_mask, IB_MGMT_MAX_METHODS,
1+i)) {
if ((*method)->agent[i]) {
printk(KERN_ERR "Method %d already in use\n", i);
- return EINVAL;
+ return -EINVAL;
}
}
return 0;
@@ -415,7 +415,7 @@
*method = kmalloc(sizeof **method, GFP_KERNEL);
if (!*method) {
printk(KERN_ERR "No memory for ib_mad_mgmt_method_table\n");
- return ENOMEM;
+ return -ENOMEM;
}
/* Clear management method table */
memset(*method, 0, sizeof **method);
@@ -528,13 +528,13 @@
kfree(*method);
*method = NULL;
}
- ret = EINVAL;
+ ret = -EINVAL;
goto error;
error2:
kfree(*class);
*class = NULL;
error1:
- ret = ENOMEM;
+ ret = -ENOMEM;
error:
return ret;
}
More information about the general
mailing list