diff mbox series

[1/7] v4l2-subdev.c: kvmalloc_array -> kvcalloc

Message ID 20220509091553.2637089-2-hverkuil-cisco@xs4all.nl
State Accepted
Commit 8af592e2ecbcd20e55fe01f24933ccdb6ec4a93c
Headers show
Series [1/7] v4l2-subdev.c: kvmalloc_array -> kvcalloc | expand

Commit Message

Hans Verkuil May 9, 2022, 9:15 a.m. UTC
Fixes smatch warning:

drivers/media/v4l2-core/v4l2-subdev.c:978 __v4l2_subdev_state_alloc() warn: Please consider using kvcalloc instead

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 drivers/media/v4l2-core/v4l2-subdev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 3da200bb23dd..5c27bac772ea 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -975,9 +975,8 @@  __v4l2_subdev_state_alloc(struct v4l2_subdev *sd, const char *lock_name,
 		state->lock = &state->_lock;
 
 	if (sd->entity.num_pads) {
-		state->pads = kvmalloc_array(sd->entity.num_pads,
-					     sizeof(*state->pads),
-					     GFP_KERNEL | __GFP_ZERO);
+		state->pads = kvcalloc(sd->entity.num_pads,
+				       sizeof(*state->pads), GFP_KERNEL);
 		if (!state->pads) {
 			ret = -ENOMEM;
 			goto err;