]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: v4l2-subdev.c: kvmalloc_array -> kvcalloc
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 2 May 2022 07:14:42 +0000 (09:14 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 09:02:22 +0000 (11:02 +0200)
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>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/v4l2-core/v4l2-subdev.c

index 3da200bb23dd29c391b970ca76719ba4e0e088d3..5c27bac772ea4330f6e25f5bde6dbc9fd58bf218 100644 (file)
@@ -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;