Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: amlogic - Remove kcalloc without check

There is no real point in allocating dedicated memory for the irqs array.
MAXFLOW is only 2, so it is easier to allocated the needed space
directly within the 'meson_dev' structure.

This saves some memory allocation and avoids an indirection when using the
irqs array.

Fixes: 48fe583fe541 ("crypto: amlogic - Add crypto accelerator...")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Christophe JAILLET and committed by
Herbert Xu
3d780c8a 4d2b225a

+1 -2
-1
drivers/crypto/amlogic/amlogic-gxl-core.c
··· 237 237 return err; 238 238 } 239 239 240 - mc->irqs = devm_kcalloc(mc->dev, MAXFLOW, sizeof(int), GFP_KERNEL); 241 240 for (i = 0; i < MAXFLOW; i++) { 242 241 mc->irqs[i] = platform_get_irq(pdev, i); 243 242 if (mc->irqs[i] < 0)
+1 -1
drivers/crypto/amlogic/amlogic-gxl.h
··· 95 95 struct device *dev; 96 96 struct meson_flow *chanlist; 97 97 atomic_t flow; 98 - int *irqs; 98 + int irqs[MAXFLOW]; 99 99 #ifdef CONFIG_CRYPTO_DEV_AMLOGIC_GXL_DEBUG 100 100 struct dentry *dbgfs_dir; 101 101 #endif