mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
scsi: ufs: Check qcg before dereferencing
Check qcg before dereferencing to avoid NULL pointer dereference and return if its NULL. This is is to fix below kw warnings. ufs-qcom.c:2489: 'qcg' is assigned the return value from function 'cpu_to_group'. ufs-qcom.c:2439: 'cpu_to_group' explicitly returns a NULL value. ufs-qcom.c:2490: 'qcg' is explicitly dereferenced. Change-Id: I291c9230bb7fb5df414db8f80bfb17a50c8fc7cf Signed-off-by: Nitin Rawat <nitirawa@codeaurora.org>
This commit is contained in:
parent
e0f5b51058
commit
d553a0ff41
1 changed files with 3 additions and 0 deletions
|
|
@ -2487,6 +2487,9 @@ static void ufs_qcom_qos(struct ufs_hba *hba, int tag, bool is_scsi_cmd)
|
|||
if (cpu < 0)
|
||||
return;
|
||||
qcg = cpu_to_group(host->ufs_qos, cpu);
|
||||
if (!qcg)
|
||||
return;
|
||||
|
||||
if (qcg->voted) {
|
||||
dev_dbg(qcg->host->hba->dev, "%s: qcg: 0x%08x | Mask: 0x%08x - Already voted - return\n",
|
||||
__func__, qcg, qcg->mask);
|
||||
|
|
|
|||
Loading…
Reference in a new issue