diff options
author | Michael S. Tsirkin <mst@mellanox.co.il> | 2006-04-10 16:17:43 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-04-10 16:17:43 -0400 |
commit | ce684df05a531904ea055d01aeee75321fa0db1e (patch) | |
tree | 0190ad3a94d12efeed218abe8e69a9062a75c75c /drivers/infiniband | |
parent | f697f74a6b189702474b2fd457e1f9365fa213e3 (diff) |
IB/cache: Use correct pointer to calculate size
When allocating gid_cache, use kmalloc(sizeof *gid_cache, ...) rather
than kmalloc(sizeof *pkey_cache, ...). It doesn't really matter which
one is used, since the size ends up the same either way, but it's much
better to say what we mean.
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index c57a3871184c..50364c0b090c 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c | |||
@@ -302,7 +302,7 @@ static void ib_cache_setup_one(struct ib_device *device) | |||
302 | kmalloc(sizeof *device->cache.pkey_cache * | 302 | kmalloc(sizeof *device->cache.pkey_cache * |
303 | (end_port(device) - start_port(device) + 1), GFP_KERNEL); | 303 | (end_port(device) - start_port(device) + 1), GFP_KERNEL); |
304 | device->cache.gid_cache = | 304 | device->cache.gid_cache = |
305 | kmalloc(sizeof *device->cache.pkey_cache * | 305 | kmalloc(sizeof *device->cache.gid_cache * |
306 | (end_port(device) - start_port(device) + 1), GFP_KERNEL); | 306 | (end_port(device) - start_port(device) + 1), GFP_KERNEL); |
307 | 307 | ||
308 | if (!device->cache.pkey_cache || !device->cache.gid_cache) { | 308 | if (!device->cache.pkey_cache || !device->cache.gid_cache) { |