From ce684df05a531904ea055d01aeee75321fa0db1e Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Mon, 10 Apr 2006 13:17:43 -0700 Subject: [PATCH] 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 Signed-off-by: Roland Dreier --- drivers/infiniband/core/cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index c57a3871184..50364c0b090 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) kmalloc(sizeof *device->cache.pkey_cache * (end_port(device) - start_port(device) + 1), GFP_KERNEL); device->cache.gid_cache = - kmalloc(sizeof *device->cache.pkey_cache * + kmalloc(sizeof *device->cache.gid_cache * (end_port(device) - start_port(device) + 1), GFP_KERNEL); if (!device->cache.pkey_cache || !device->cache.gid_cache) { -- 2.32.0.93.g670b81a890