diff options
author | Dotan Barak <dotanb@dev.mellanox.co.il> | 2007-07-10 09:55:57 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-07-10 14:04:40 -0400 |
commit | 856c52a741950dc0be2c5c231efec626e9a0a3fa (patch) | |
tree | 9cb262566a3a0521ce6b560813443b3f19b744a4 /drivers/infiniband | |
parent | f72d2f081453d8b1ea36e47478c3463042746ddc (diff) |
IB/core: Take sizeof the correct pointer when calling kmalloc()
When allocating out_mad in show_pma_counter(), take sizeof *out_mad
instead of sizeof *in_mad. 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@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index 08c299ebf4a8..6265a3fee076 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, | |||
311 | return sprintf(buf, "N/A (no PMA)\n"); | 311 | return sprintf(buf, "N/A (no PMA)\n"); |
312 | 312 | ||
313 | in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); | 313 | in_mad = kzalloc(sizeof *in_mad, GFP_KERNEL); |
314 | out_mad = kmalloc(sizeof *in_mad, GFP_KERNEL); | 314 | out_mad = kmalloc(sizeof *out_mad, GFP_KERNEL); |
315 | if (!in_mad || !out_mad) { | 315 | if (!in_mad || !out_mad) { |
316 | ret = -ENOMEM; | 316 | ret = -ENOMEM; |
317 | goto out; | 317 | goto out; |