scsi: ufshcd: Fix NULL pointer dereference for in ufshcd_init
[ Upstream commit eebcc19646489b68399ce7b35d9c38eb9f4ec40f ] Error paths in ufshcd_init() ufshcd_hba_exit() killed clk_scaling workqueue when the workqueue is actually created quite late in ufshcd_init(). So, we end up getting NULL pointer dereference in such error paths. Fix this by moving clk_scaling initialization and kill codes to two separate methods, and call them at required places. Fixes: 401f1e44 ("scsi: ufs: don't suspend clock scaling during clock gating") Signed-off-by: NVivek Gautam <vivek.gautam@codeaurora.org> Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Subhash Jadavani <subhashj@codeaurora.org> Cc: Matthias Kaehlcke <mka@chromium.org> Cc: Evan Green <evgreen@chromium.org> Cc: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: NEvan Green <evgreen@chromium.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com> Signed-off-by: NSasha Levin <sashal@kernel.org>
Showing
想要评论请 注册 或 登录