summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2015-04-30 18:47:03 +0300
committerAlex Deucher <alexander.deucher@amd.com>2015-06-04 04:03:23 +0300
commitc92b90ccc20bb55a3a0bb8fcc55c18d0710f8cb7 (patch)
treeaa11a1ab074c25deae4914f0024c08b3374f02d4 /drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
parent1045745742fc12c1320ccce849ca2810c6563f8d (diff)
downloadlinux-c92b90ccc20bb55a3a0bb8fcc55c18d0710f8cb7.tar.xz
drm/amdgpu: memset gds_info struct in info ioctl
Avoids possibility that info may leak via the uninitialized _pad element. Noticed-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index c271da34998d..2d50c6dbdcbb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -345,6 +345,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
case AMDGPU_INFO_GDS_CONFIG: {
struct drm_amdgpu_info_gds gds_info;
+ memset(&gds_info, 0, sizeof(gds_info));
gds_info.gds_gfx_partition_size = adev->gds.mem.gfx_partition_size >> AMDGPU_GDS_SHIFT;
gds_info.compute_partition_size = adev->gds.mem.cs_partition_size >> AMDGPU_GDS_SHIFT;
gds_info.gds_total_size = adev->gds.mem.total_size >> AMDGPU_GDS_SHIFT;