From: Andrew Morton With gcc-3.4.5 on sparc64 (http://userweb.kernel.org/~akpm/cross-compilers/) and CONFIG_SLUB (via allmodconfig) I get ERROR: "__kmalloc_size_too_large" [drivers/infiniband/hw/ipath/ib_ipath.ko] undefined! It works OK with slab. Replacing `count' with `sizeof(struct ipath_flash)' in the kmalloc statement doesn't help. But this fixed it. Weird. Cc: Roland Dreier Cc: Christoph Lameter Cc: "David S. Miller" Signed-off-by: Andrew Morton --- drivers/infiniband/hw/ipath/ipath_fs.c | 5 ----- 1 file changed, 5 deletions(-) diff -puN drivers/infiniband/hw/ipath/ipath_fs.c~infiniband-work-around-gcc-slub-problem drivers/infiniband/hw/ipath/ipath_fs.c --- a/drivers/infiniband/hw/ipath/ipath_fs.c~infiniband-work-around-gcc-slub-problem +++ a/drivers/infiniband/hw/ipath/ipath_fs.c @@ -365,11 +365,6 @@ static ssize_t flash_write(struct file * goto bail; } - if (count != sizeof(struct ipath_flash)) { - ret = -EINVAL; - goto bail; - } - tmp = kmalloc(count, GFP_KERNEL); if (!tmp) { ret = -ENOMEM; _