From: Al Viro Date: Tue, 31 Mar 2015 15:43:52 +0000 (-0400) Subject: ioctx_alloc(): remove pointless check X-Git-Tag: KARO-TXA5-2015-06-26~105^2~29 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9c4b6f6975acfefcec3195a40bd96f5cfa9edbc9;p=karo-tx-linux.git ioctx_alloc(): remove pointless check Way, way back kiocb used to be picked from arrays, so ioctx_alloc() checked for multiplication overflow when calculating the size of such array. By the time fs/aio.c went into the tree (in 2002) they were already allocated one-by-one by kmem_cache_alloc(), so that check had already become pointless. Let's bury it... Signed-off-by: Al Viro --- diff --git a/fs/aio.c b/fs/aio.c index 3b8467aeb5ee..40fddf4217bd 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -688,8 +688,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) nr_events *= 2; /* Prevent overflows */ - if ((nr_events > (0x10000000U / sizeof(struct io_event))) || - (nr_events > (0x10000000U / sizeof(struct kiocb)))) { + if (nr_events > (0x10000000U / sizeof(struct io_event))) { pr_debug("ENOMEM: nr_events too high\n"); return ERR_PTR(-EINVAL); }