Re: [PATCH v18 1/2] scsi: ufs: Enable power management for wlun

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

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@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux