diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-03-03 03:27:59 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-03-03 18:51:37 +0300 |
commit | 8dbc2ccac5a65c5b57e3070e36a3dc97c7970d96 (patch) | |
tree | cee2cdc0b428ecfd209d93ec6fee69958fb3bc54 /drivers/gpu/drm/radeon/radeon_kms.c | |
parent | 147ab7a187511a97d723cdec69b485e8aad237a5 (diff) | |
download | linux-8dbc2ccac5a65c5b57e3070e36a3dc97c7970d96.tar.xz |
drm/radeon: fix copy of uninitialized variable back to userspace
Currently the ioctl command RADEON_INFO_SI_BACKEND_ENABLED_MASK can
copy back uninitialised data in value_tmp that pointer *value points
to. This can occur when rdev->family is less than CHIP_BONAIRE and
less than CHIP_TAHITI. Fix this by adding in a missing -EINVAL
so that no invalid value is copied back to userspace.
Addresses-Coverity: ("Uninitialized scalar variable)
Cc: stable@vger.kernel.org # 3.13+
Fixes: 439a1cfffe2c ("drm/radeon: expose render backend mask to the userspace")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_kms.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_kms.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 2479d6ab7a36..58876bb4ef2a 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -518,6 +518,7 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) *value = rdev->config.si.backend_enable_mask; } else { DRM_DEBUG_KMS("BACKEND_ENABLED_MASK is si+ only!\n"); + return -EINVAL; } break; case RADEON_INFO_MAX_SCLK: |