tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git   
master
head:   89bf6e28373beef9577fa71f996a5f73a569617c
commit: 0b639decf65160b1afd9993019be37d7869c0340 [1261/3190] scsi: pm8001: 
Modify task abort handling for SATA task
config: x86_64-randconfig-m001-20221024
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <l...@intel.com>
| Reported-by: Dan Carpenter <dan.carpen...@oracle.com>

smatch warnings:
drivers/scsi/pm8001/pm8001_sas.c:996 pm8001_abort_task() warn: variable 
dereferenced before check 'task' (see line 986)

vim +/task +996 drivers/scsi/pm8001/pm8001_sas.c

dbf9bfe615717d jack wang    2009-10-14   984  int pm8001_abort_task(struct 
sas_task *task)
dbf9bfe615717d jack wang    2009-10-14   985  {
0b639decf65160 John Garry   2022-10-17  @986    struct pm8001_ccb_info *ccb = 
task->lldd_task;
                                                                              
^^^^^^^^^^^^^^^
Unchecked dereference

dbf9bfe615717d jack wang    2009-10-14   987    unsigned long flags;
1db49906d8fa87 Viswas G     2017-10-18   988    u32 tag;
dbf9bfe615717d jack wang    2009-10-14   989    struct domain_device *dev ;
1db49906d8fa87 Viswas G     2017-10-18   990    struct pm8001_hba_info 
*pm8001_ha;
dbf9bfe615717d jack wang    2009-10-14   991    struct pm8001_device 
*pm8001_dev;
869ddbdcae3b4f Viswas G     2017-10-18   992    int rc = TMF_RESP_FUNC_FAILED, 
ret;
ee05cb71f9f7eb Ajish Koshy  2021-12-28   993    u32 phy_id, port_id;
869ddbdcae3b4f Viswas G     2017-10-18   994    struct sas_task_slow slow_task;
a961ea0afd632c akshatzen    2021-01-09   995  
dbf9bfe615717d jack wang    2009-10-14  @996    if (unlikely(!task || 
!task->lldd_task || !task->dev))
                                                              ^^^^
Too late.  This warning will not trigger if you have the cross function
database because "task" can never actually be NULL so the checking is
wrong but harmless.

1db49906d8fa87 Viswas G     2017-10-18   997            return 
TMF_RESP_FUNC_FAILED;
a961ea0afd632c akshatzen    2021-01-09   998  
1db49906d8fa87 Viswas G     2017-10-18   999    dev = task->dev;
1db49906d8fa87 Viswas G     2017-10-18  1000    pm8001_dev = dev->lldd_dev;

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp  
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to