summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-09-09 09:14:10 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-09-09 09:14:10 +0000
commit5d219aa2f110515a6a6faa6294103e4ddd017802 (patch)
treeb76d24169cf48a1d4c14714d7eec45a79a042b44 /sys/dev
parent6867b02b20807241feebd770502b6179bd082a5b (diff)
drm/amdgpu: Fix the uninitialized variable warning
From Ma Jun f71ef2bb69dde228e0788e8e309d3d9d73f458c3 in linux-6.6.y/6.6.50 7e39d7ec35883a168343ea02f40e260e176c6c63 in mainline linux
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_securedisplay.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_securedisplay.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_securedisplay.c
index 8ed0e073656..41ebe690eef 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_securedisplay.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_securedisplay.c
@@ -135,6 +135,10 @@ static ssize_t amdgpu_securedisplay_debugfs_write(struct file *f, const char __u
mutex_unlock(&psp->securedisplay_context.mutex);
break;
case 2:
+ if (size < 3 || phy_id >= TA_SECUREDISPLAY_MAX_PHY) {
+ dev_err(adev->dev, "Invalid input: %s\n", str);
+ return -EINVAL;
+ }
mutex_lock(&psp->securedisplay_context.mutex);
psp_prep_securedisplay_cmd_buf(psp, &securedisplay_cmd,
TA_SECUREDISPLAY_COMMAND__SEND_ROI_CRC);