Unverified Commit 0b22d093 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4188 [sync] PR-4012: drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL

parents e4668e3a f9589653
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -575,6 +575,9 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,
	ssize_t result = 0;
	int r;

	if (!adev->smc_rreg)
		return -EPERM;

	if (size & 0x3 || *pos & 0x3)
		return -EINVAL;

@@ -634,6 +637,9 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user *
	ssize_t result = 0;
	int r;

	if (!adev->smc_wreg)
		return -EPERM;

	if (size & 0x3 || *pos & 0x3)
		return -EINVAL;