mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 09:55:19 +02:00
drm/amdgpu: Fix the uninitialized variable warning
[ Upstream commit 7e39d7ec35
]
Check the user input and phy_id value range to fix
"Using uninitialized value phy_id"
Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3ad44174a5
commit
f71ef2bb69
|
@ -135,6 +135,10 @@ static ssize_t amdgpu_securedisplay_debugfs_write(struct file *f, const char __u
|
||||||
mutex_unlock(&psp->securedisplay_context.mutex);
|
mutex_unlock(&psp->securedisplay_context.mutex);
|
||||||
break;
|
break;
|
||||||
case 2:
|
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);
|
mutex_lock(&psp->securedisplay_context.mutex);
|
||||||
psp_prep_securedisplay_cmd_buf(psp, &securedisplay_cmd,
|
psp_prep_securedisplay_cmd_buf(psp, &securedisplay_cmd,
|
||||||
TA_SECUREDISPLAY_COMMAND__SEND_ROI_CRC);
|
TA_SECUREDISPLAY_COMMAND__SEND_ROI_CRC);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user