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

Commit 378d03f4 authored by Sayali Lokhande's avatar Sayali Lokhande
Browse files

scsi: ufs: Add check before calling device_remove_file



This change adds check if clock scaling is supported before
calling device_remove_file on ufs clk_scaling.enable_attr to
avoid null pointer dereference.

Change-Id: I3bf228c08b5dcf6528f606d0dfa792d10ce408d2
Signed-off-by: default avatarSayali Lokhande <sayalil@codeaurora.org>
parent 84a47e8c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -9689,6 +9689,8 @@ static void __ufshcd_shutdown_clkscaling(struct ufs_hba *hba)

static void ufshcd_shutdown_clkscaling(struct ufs_hba *hba)
{
	if (!ufshcd_is_clkscaling_supported(hba))
		return;
	__ufshcd_shutdown_clkscaling(hba);
	device_remove_file(hba->dev, &hba->clk_scaling.enable_attr);
}