Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83094b23 authored by Asutosh Das's avatar Asutosh Das
Browse files

scsi: ufshcd-qti: Fix null pointer check



Checks for null before using the memory.

Change-Id: Idcf45ccf7d81ebe9b9a81905ad4f42da02827492
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent b3d46413
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7530,6 +7530,8 @@ static u32 ufshcd_get_max_icc_level(int sup_curr_uA, u32 start_scan, char *buff)
		len = start_scan;

	pd = kmalloc_array(len, sizeof(*pd), GFP_KERNEL);
	if (!pd)
		return 0;
	memcpy(pd, buff, len);

	for (i = start_scan; i >= 0; i--) {