From: Dan Carpenter <dan.carpenter@oracle.com>
To: cang@codeaurora.org
Cc: linux-scsi@vger.kernel.org
Subject: [bug report] scsi: ufs: Serialize eh_work with system PM events and async scan
Date: Fri, 11 Dec 2020 13:06:20 +0300 [thread overview]
Message-ID: <X9NEnPx/3fb+K9AE@mwanda> (raw)
Hello Can Guo,
This is a semi-automatic email about new static checker warnings.
The patch 88a92d6ae4fe: "scsi: ufs: Serialize eh_work with system PM
events and async scan" from Dec 2, 2020, leads to the following
Smatch complaint:
drivers/scsi/ufs/ufshcd.c:8971 ufshcd_system_resume()
error: we previously assumed 'hba' could be null (see line 8970)
drivers/scsi/ufs/ufshcd.c
8965 int ufshcd_system_resume(struct ufs_hba *hba)
8966 {
8967 int ret = 0;
8968 ktime_t start = ktime_get();
8969
8970 if (!hba) {
8971 up(&hba->eh_sem);
If "hba" is NULL then this will Oops, but I suspect that we could just
remove the check for NULL.
8972 return -EINVAL;
8973 }
8974
8975 if (!hba->is_powered || pm_runtime_suspended(hba->dev))
8976 /*
8977 * Let the runtime resume take care of resuming
8978 * if runtime suspended.
8979 */
8980 goto out;
8981 else
8982 ret = ufshcd_resume(hba, UFS_SYSTEM_PM);
8983 out:
8984 trace_ufshcd_system_resume(dev_name(hba->dev), ret,
8985 ktime_to_us(ktime_sub(ktime_get(), start)),
8986 hba->curr_dev_pwr_mode, hba->uic_link_state);
8987 if (!ret)
8988 hba->is_sys_suspended = false;
8989 up(&hba->eh_sem);
8990 return ret;
8991 }
regards,
dan carpenter
reply other threads:[~2020-12-11 10:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=X9NEnPx/3fb+K9AE@mwanda \
--to=dan.carpenter@oracle.com \
--cc=cang@codeaurora.org \
--cc=linux-scsi@vger.kernel.org \
/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