drm/radeon: fix copy of uninitialized variable back to userspace
commit8dbc2ccac5upstream. 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:439a1cfffe("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
09b031b5fc
commit
9b50c185d2
1 changed files with 1 additions and 0 deletions
|
|
@ -512,6 +512,7 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file
|
|||
*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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue