Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: pm8001: Drop !task check in pm8001_abort_task()

In commit 0b639decf651 ("scsi: pm8001: Modify task abort handling for SATA
task"), code was introduced to dereference "task" pointer in
pm8001_abort_task(). However there was a pre-existing later check for
"!task", which spooked the kernel test robot.

Function pm8001_abort_task() should never be passed NULL for "task"
pointer, so remove that check. Also remove the "unlikely" hint, as this is
not fastpath code.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Link: https://lore.kernel.org/r/1666781764-123090-1-git-send-email-john.garry@huawei.com
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

John Garry and committed by
Martin K. Petersen
4481bdc6 9d266e79

+1 -1
+1 -1
drivers/scsi/pm8001/pm8001_sas.c
··· 979 979 u32 phy_id, port_id; 980 980 struct sas_task_slow slow_task; 981 981 982 - if (unlikely(!task || !task->lldd_task || !task->dev)) 982 + if (!task->lldd_task || !task->dev) 983 983 return TMF_RESP_FUNC_FAILED; 984 984 985 985 dev = task->dev;