From: Matthias Kaehlcke <mka@chromium.org>
To: Vinayak Holikatti <vinholikatti@gmail.com>,
"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Subhash Jadavani <subhashj@codeaurora.org>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Evan Green <evgreen@chromium.org>,
Douglas Anderson <dianders@chromium.org>,
Stephen Boyd <sboyd@kernel.org>,
Matthias Kaehlcke <mka@chromium.org>
Subject: [PATCH] scsi: ufs: Check workqueue exists before destroying it
Date: Wed, 1 Aug 2018 17:14:35 -0700 [thread overview]
Message-ID: <20180802001435.116963-1-mka@chromium.org> (raw)
In ufshcd_hba_exit() the clock gating workqueue is always destroyed
when clock gating is supported. However the workqueue pointer is NULL
when ufshcd_init() fails before the workqueue is created. Only destroy
the workqueue if it exists.
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
drivers/scsi/ufs/ufshcd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 397081d320b1..401f7dbe2981 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -7190,7 +7190,8 @@ static void ufshcd_hba_exit(struct ufs_hba *hba)
if (ufshcd_is_clkscaling_supported(hba)) {
if (hba->devfreq)
ufshcd_suspend_clkscaling(hba);
- destroy_workqueue(hba->clk_scaling.workq);
+ if (hba->clk_scaling.workq)
+ destroy_workqueue(hba->clk_scaling.workq);
ufshcd_devfreq_remove(hba);
}
ufshcd_setup_clocks(hba, false);
--
2.18.0.597.ga71716f1ad-goog
next reply other threads:[~2018-08-02 0:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 0:14 Matthias Kaehlcke [this message]
2018-08-07 17:09 ` [PATCH] scsi: ufs: Check workqueue exists before destroying it Evan Green
2018-08-08 6:24 ` Stephen Boyd
2018-08-09 18:57 ` Matthias Kaehlcke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180802001435.116963-1-mka@chromium.org \
--to=mka@chromium.org \
--cc=dianders@chromium.org \
--cc=evgreen@chromium.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sboyd@kernel.org \
--cc=subhashj@codeaurora.org \
--cc=vinholikatti@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).