diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-01-13 12:28:04 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-01-17 18:21:12 +0000 |
commit | f9bdb7fdd2cac17bdc9c344b6036e6939fa087cd (patch) | |
tree | 39431fea4995ffe718531c8a6e4f367c2572c67f /drivers/spi/spi.c | |
parent | fafd67940774733fa97f4b09412aea6981b82e0a (diff) | |
download | op-kernel-dev-f9bdb7fdd2cac17bdc9c344b6036e6939fa087cd.zip op-kernel-dev-f9bdb7fdd2cac17bdc9c344b6036e6939fa087cd.tar.gz |
spi: Use kcalloc() in spi_register_board_info()
A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus reuse the corresponding function "kcalloc".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r-- | drivers/spi/spi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 656dd3e..8c05f27 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -672,7 +672,7 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n) if (!n) return -EINVAL; - bi = kzalloc(n * sizeof(*bi), GFP_KERNEL); + bi = kcalloc(n, sizeof(*bi), GFP_KERNEL); if (!bi) return -ENOMEM; |