From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Asutosh Das <asutoshd@codeaurora.org>,
cang@codeaurora.org, martin.petersen@oracle.com,
adrian.hunter@intel.com, linux-scsi@vger.kernel.org
Cc: lkp@intel.com, kbuild-all@lists.01.org,
Asutosh Das <asutoshd@codeaurora.org>,
linux-arm-msm@vger.kernel.org,
Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Pedro Sousa <pedrom.sousa@synopsys.com>
Subject: Re: [PATCH v18 1/2] scsi: ufs: Enable power management for wlun
Date: Thu, 15 Apr 2021 21:22:03 +0300 [thread overview]
Message-ID: <20210415182203.GE6021@kadam> (raw)
In-Reply-To: <d1a6af736730b9d79f977100286c5d9325546ac2.1618426513.git.asutoshd@codeaurora.org>
[-- Attachment #1: Type: text/plain, Size: 6601 bytes --]
Hi Asutosh,
url: https://github.com/0day-ci/linux/commits/Asutosh-Das/Enable-power-management-for-ufs-wlun/20210415-030146
base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: i386-randconfig-m021-20210415 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
drivers/scsi/ufs/ufshcd.c:9017 ufshcd_wl_resume() error: potentially dereferencing uninitialized 'hba'.
drivers/scsi/ufs/ufshcd.c:9141 ufshcd_system_suspend() error: uninitialized symbol 'ret'.
drivers/scsi/ufs/ufshcd.c:9166 ufshcd_system_resume() error: uninitialized symbol 'ret'.
Old smatch warnings:
drivers/scsi/ufs/ufshcd.c:5112 ufshcd_uic_cmd_compl() error: we previously assumed 'hba->active_uic_cmd' could be null (see line 5100)
vim +/hba +9017 drivers/scsi/ufs/ufshcd.c
9bad6c1c707d2a Asutosh Das 2021-04-14 8998
9bad6c1c707d2a Asutosh Das 2021-04-14 8999 static int ufshcd_wl_resume(struct device *dev)
9bad6c1c707d2a Asutosh Das 2021-04-14 9000 {
9bad6c1c707d2a Asutosh Das 2021-04-14 9001 struct scsi_device *sdev = to_scsi_device(dev);
9bad6c1c707d2a Asutosh Das 2021-04-14 9002 struct ufs_hba *hba;
^^^
9bad6c1c707d2a Asutosh Das 2021-04-14 9003 int ret = 0;
9bad6c1c707d2a Asutosh Das 2021-04-14 9004 ktime_t start = ktime_get();
9bad6c1c707d2a Asutosh Das 2021-04-14 9005
9bad6c1c707d2a Asutosh Das 2021-04-14 9006 if (pm_runtime_suspended(dev))
9bad6c1c707d2a Asutosh Das 2021-04-14 9007 goto out;
^^^^^^^^
9bad6c1c707d2a Asutosh Das 2021-04-14 9008
9bad6c1c707d2a Asutosh Das 2021-04-14 9009 hba = shost_priv(sdev->host);
9bad6c1c707d2a Asutosh Das 2021-04-14 9010
9bad6c1c707d2a Asutosh Das 2021-04-14 9011 ret = __ufshcd_wl_resume(hba, UFS_SYSTEM_PM);
9bad6c1c707d2a Asutosh Das 2021-04-14 9012 if (ret)
9bad6c1c707d2a Asutosh Das 2021-04-14 9013 dev_err(&sdev->sdev_gendev, "%s failed: %d\n", __func__, ret);
9bad6c1c707d2a Asutosh Das 2021-04-14 9014 out:
9bad6c1c707d2a Asutosh Das 2021-04-14 9015 trace_ufshcd_wl_resume(dev_name(dev), ret,
9bad6c1c707d2a Asutosh Das 2021-04-14 9016 ktime_to_us(ktime_sub(ktime_get(), start)),
9bad6c1c707d2a Asutosh Das 2021-04-14 @9017 hba->curr_dev_pwr_mode, hba->uic_link_state);
^^^^^^^^^^^^^^^^^^^^^^
Uninitialized.
9bad6c1c707d2a Asutosh Das 2021-04-14 9018 if (!ret)
9bad6c1c707d2a Asutosh Das 2021-04-14 9019 hba->is_sys_suspended = false;
9bad6c1c707d2a Asutosh Das 2021-04-14 9020 up(&hba->host_sem);
9bad6c1c707d2a Asutosh Das 2021-04-14 9021 return ret;
9bad6c1c707d2a Asutosh Das 2021-04-14 9022 }
[ snip ]
57d104c153d3d6 Subhash Jadavani 2014-09-25 9131 int ufshcd_system_suspend(struct ufs_hba *hba)
7a3e97b0dc4bba Santosh Yaraganavi 2012-02-29 9132 {
9bad6c1c707d2a Asutosh Das 2021-04-14 9133 int ret;
7ff5ab47363334 Subhash Jadavani 2016-12-22 9134 ktime_t start = ktime_get();
57d104c153d3d6 Subhash Jadavani 2014-09-25 9135
9bad6c1c707d2a Asutosh Das 2021-04-14 9136 if (pm_runtime_suspended(hba->dev))
57d104c153d3d6 Subhash Jadavani 2014-09-25 9137 goto out;
^^^^^^^^
3b1d05807a9a68 Vinayak Holikatti 2013-02-25 9138
9bad6c1c707d2a Asutosh Das 2021-04-14 9139 ret = ufshcd_suspend(hba);
57d104c153d3d6 Subhash Jadavani 2014-09-25 9140 out:
7ff5ab47363334 Subhash Jadavani 2016-12-22 @9141 trace_ufshcd_system_suspend(dev_name(hba->dev), ret,
^^^
"ret" uninitialized.
7ff5ab47363334 Subhash Jadavani 2016-12-22 9142 ktime_to_us(ktime_sub(ktime_get(), start)),
73eba2be9203c0 Subhash Jadavani 2017-01-10 9143 hba->curr_dev_pwr_mode, hba->uic_link_state);
57d104c153d3d6 Subhash Jadavani 2014-09-25 9144 return ret;
57d104c153d3d6 Subhash Jadavani 2014-09-25 9145 }
57d104c153d3d6 Subhash Jadavani 2014-09-25 9146 EXPORT_SYMBOL(ufshcd_system_suspend);
57d104c153d3d6 Subhash Jadavani 2014-09-25 9147
57d104c153d3d6 Subhash Jadavani 2014-09-25 9148 /**
57d104c153d3d6 Subhash Jadavani 2014-09-25 9149 * ufshcd_system_resume - system resume routine
57d104c153d3d6 Subhash Jadavani 2014-09-25 9150 * @hba: per adapter instance
57d104c153d3d6 Subhash Jadavani 2014-09-25 9151 *
57d104c153d3d6 Subhash Jadavani 2014-09-25 9152 * Returns 0 for success and non-zero for failure
57d104c153d3d6 Subhash Jadavani 2014-09-25 9153 */
57d104c153d3d6 Subhash Jadavani 2014-09-25 9154
57d104c153d3d6 Subhash Jadavani 2014-09-25 9155 int ufshcd_system_resume(struct ufs_hba *hba)
66ec6d59407baf Sujit Reddy Thumma 2013-07-30 9156 {
9bad6c1c707d2a Asutosh Das 2021-04-14 9157 int ret;
7ff5ab47363334 Subhash Jadavani 2016-12-22 9158 ktime_t start = ktime_get();
7ff5ab47363334 Subhash Jadavani 2016-12-22 9159
9bad6c1c707d2a Asutosh Das 2021-04-14 9160 if (pm_runtime_suspended(hba->dev))
7ff5ab47363334 Subhash Jadavani 2016-12-22 9161 goto out;
9bad6c1c707d2a Asutosh Das 2021-04-14 9162
9bad6c1c707d2a Asutosh Das 2021-04-14 9163 ret = ufshcd_resume(hba);
9bad6c1c707d2a Asutosh Das 2021-04-14 9164
7ff5ab47363334 Subhash Jadavani 2016-12-22 9165 out:
7ff5ab47363334 Subhash Jadavani 2016-12-22 @9166 trace_ufshcd_system_resume(dev_name(hba->dev), ret,
^^^
ret uninitialized
7ff5ab47363334 Subhash Jadavani 2016-12-22 9167 ktime_to_us(ktime_sub(ktime_get(), start)),
73eba2be9203c0 Subhash Jadavani 2017-01-10 9168 hba->curr_dev_pwr_mode, hba->uic_link_state);
9bad6c1c707d2a Asutosh Das 2021-04-14 9169
7ff5ab47363334 Subhash Jadavani 2016-12-22 9170 return ret;
57d104c153d3d6 Subhash Jadavani 2014-09-25 9171 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 39334 bytes --]
next prev parent reply other threads:[~2021-04-15 18:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 18:58 [PATCH v18 0/2] Enable power management for ufs wlun Asutosh Das
2021-04-14 18:58 ` [PATCH v18 1/2] scsi: ufs: Enable power management for wlun Asutosh Das
2021-04-14 22:41 ` kernel test robot
2021-04-15 11:06 ` Adrian Hunter
2021-04-15 18:22 ` Dan Carpenter [this message]
2021-04-15 23:11 ` Bart Van Assche
2021-04-16 2:10 ` Martin K. Petersen
2021-04-16 18:21 ` Asutosh Das (asd)
2021-04-14 18:58 ` [PATCH v18 2/2] ufs: sysfs: Resume the proper scsi device Asutosh Das
2021-04-15 9:21 ` Adrian Hunter
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=20210415182203.GE6021@kadam \
--to=dan.carpenter@oracle.com \
--cc=adrian.hunter@intel.com \
--cc=alim.akhtar@samsung.com \
--cc=asutoshd@codeaurora.org \
--cc=avri.altman@wdc.com \
--cc=cang@codeaurora.org \
--cc=jejb@linux.ibm.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=lkp@intel.com \
--cc=martin.petersen@oracle.com \
--cc=pedrom.sousa@synopsys.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).