drm/vmwgfx: Fix frame-size warning in vmw_mksstat_add_ioctl
authorMartin Krastev <krastevm@vmware.com>
Sat, 22 Oct 2022 04:02:21 +0000 (00:02 -0400)
committerZack Rusin <zackr@vmware.com>
Tue, 25 Oct 2022 16:42:14 +0000 (12:42 -0400)
commit3280706369f636cc6fc959a9842df5707c7fd85f
treeecebb38faf4ec16135d556a3917150890addf2c9
parent7f4c33778686cc2d34cb4ef65b4265eea874c159
drm/vmwgfx: Fix frame-size warning in vmw_mksstat_add_ioctl

Function vmw_mksstat_add_ioctl allocates three big arrays on stack.
That triggers frame-size [-Wframe-larger-than=] warning. Refactor
that function to use kmalloc_array instead.

v2: Initialize page to null to avoid possible uninitialized use of it,
    spotted by the kernel test robot <lkp@intel.com>

Signed-off-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Maaz Mombasawala <mombasawalam@vmware.com>
Signed-off-by: Zack Rusin <zackr@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221022040236.616490-3-zack@kde.org
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c