mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 17:17:04 -04:00
staging: iio: Use kcalloc instead of kzalloc.
This patch uses kcalloc instead of kzalloc function. A coccinelle script was used to make this change. Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3637d77f5f
commit
7e026b647b
@@ -547,8 +547,9 @@ static int ad7280_attr_init(struct ad7280_state *st)
|
||||
{
|
||||
int dev, ch, cnt;
|
||||
|
||||
st->iio_attr = kzalloc(sizeof(*st->iio_attr) * (st->slave_num + 1) *
|
||||
AD7280A_CELLS_PER_DEV * 2, GFP_KERNEL);
|
||||
st->iio_attr = kcalloc(2, sizeof(*st->iio_attr) *
|
||||
(st->slave_num + 1) * AD7280A_CELLS_PER_DEV,
|
||||
GFP_KERNEL);
|
||||
if (st->iio_attr == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user