mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
scsi: ufs: host: mediatek: Fix invalid access in vccqx handling
Add a NULL check before accessing the 'vccqx' pointer to prevent invalid memory access. This ensures that the function safely handles cases where 'vccq' and 'vccq2' are not initialized, improving the robustness of the power management code. Signed-off-by: Alice Chao <alice.chao@mediatek.com> Reviewed-by: Peter Wang <peter.wang@mediatek.com> Signed-off-by: Peter Wang <peter.wang@mediatek.com> Link: https://lore.kernel.org/r/20250811131423.3444014-11-peter.wang@mediatek.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
878ed88c50
commit
5863638598
|
|
@ -1629,6 +1629,9 @@ static void ufs_mtk_vccqx_set_lpm(struct ufs_hba *hba, bool lpm)
|
|||
{
|
||||
struct ufs_vreg *vccqx = NULL;
|
||||
|
||||
if (!hba->vreg_info.vccq && !hba->vreg_info.vccq2)
|
||||
return;
|
||||
|
||||
if (hba->vreg_info.vccq)
|
||||
vccqx = hba->vreg_info.vccq;
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user