[ofa-general] [PATCH] IB/core: Fix the used pointer when calling to kmalloc

Dotan Barak dotanb at dev.mellanox.co.il
Tue Jul 10 06:55:57 PDT 2007


Fix the used pointer when calling to kmalloc.

It is true that today the type of in_mad and out_mad are the same,
but this patch will give us a cleaner code.

Signed-off-by: Dotan Barak <dotanb at mellanox.co.il>

---

diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 08c299e..6265a3f 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -311,7 +311,7 @@ static ssize_t show_pma_counter(struct ib_port *p, struct port_attribute *attr,
 		return sprintf(buf, "N/A (no PMA)\n");
 
 	in_mad  = kzalloc(sizeof *in_mad, GFP_KERNEL);
-	out_mad = kmalloc(sizeof *in_mad, GFP_KERNEL);
+	out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL);
 	if (!in_mad || !out_mad) {
 		ret = -ENOMEM;
 		goto out;



More information about the general mailing list