scsi: ufs-qcom: Fix null pointer dereference

Validate the existence of pm qos groups before accessing them,
to fix null pointer dereference.

Change-Id: Iddb96afac87cf3e7a1cc48f04b3c550e81bdae4b
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
This commit is contained in:
Venkat Gopalakrishnan 2016-06-14 16:02:24 -07:00 committed by Kyle Yan
parent 9e6175fca8
commit a8de60e7e7

View file

@ -1829,6 +1829,9 @@ static void ufs_qcom_pm_qos_suspend(struct ufs_qcom_host *host)
{
int i;
if (!host->pm_qos.groups)
return;
for (i = 0; i < host->pm_qos.num_groups; i++)
flush_work(&host->pm_qos.groups[i].unvote_work);
}