All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] scsi: pm8001: Drop !task check in pm8001_abort_task()
  2022-10-26 10:56 [PATCH] scsi: pm8001: Drop !task check in pm8001_abort_task() John Garry
@ 2022-10-26 10:36 ` Jinpu Wang
  2022-10-27  0:30 ` Damien Le Moal
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jinpu Wang @ 2022-10-26 10:36 UTC (permalink / raw)
  To: John Garry
  Cc: jinpu.wang, jejb, martin.petersen, linux-scsi, linux-kernel,
	damien.lemoal

On Wed, Oct 26, 2022 at 12:25 PM John Garry <john.garry@huawei.com> wrote:
>
> 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>
Acked-by: Jack Wang <jinpu.wang@ionos.com>
>
> diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
> index 2359e827c9e6..e5673c774f66 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.c
> +++ b/drivers/scsi/pm8001/pm8001_sas.c
> @@ -979,7 +979,7 @@ int pm8001_abort_task(struct sas_task *task)
>         u32 phy_id, port_id;
>         struct sas_task_slow slow_task;
>
> -       if (unlikely(!task || !task->lldd_task || !task->dev))
> +       if (!task->lldd_task || !task->dev)
>                 return TMF_RESP_FUNC_FAILED;
>
>         dev = task->dev;
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] scsi: pm8001: Drop !task check in pm8001_abort_task()
@ 2022-10-26 10:56 John Garry
  2022-10-26 10:36 ` Jinpu Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: John Garry @ 2022-10-26 10:56 UTC (permalink / raw)
  To: jinpu.wang, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, damien.lemoal, John Garry

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>

diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index 2359e827c9e6..e5673c774f66 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -979,7 +979,7 @@ int pm8001_abort_task(struct sas_task *task)
 	u32 phy_id, port_id;
 	struct sas_task_slow slow_task;
 
-	if (unlikely(!task || !task->lldd_task || !task->dev))
+	if (!task->lldd_task || !task->dev)
 		return TMF_RESP_FUNC_FAILED;
 
 	dev = task->dev;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: pm8001: Drop !task check in pm8001_abort_task()
  2022-10-26 10:56 [PATCH] scsi: pm8001: Drop !task check in pm8001_abort_task() John Garry
  2022-10-26 10:36 ` Jinpu Wang
@ 2022-10-27  0:30 ` Damien Le Moal
  2022-10-27  2:23 ` Martin K. Petersen
  2022-11-08  4:01 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Damien Le Moal @ 2022-10-27  0:30 UTC (permalink / raw)
  To: John Garry, jinpu.wang, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel

On 10/26/22 19:56, John Garry wrote:
> 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>
> 
> diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
> index 2359e827c9e6..e5673c774f66 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.c
> +++ b/drivers/scsi/pm8001/pm8001_sas.c
> @@ -979,7 +979,7 @@ int pm8001_abort_task(struct sas_task *task)
>  	u32 phy_id, port_id;
>  	struct sas_task_slow slow_task;
>  
> -	if (unlikely(!task || !task->lldd_task || !task->dev))
> +	if (!task->lldd_task || !task->dev)
>  		return TMF_RESP_FUNC_FAILED;
>  
>  	dev = task->dev;

Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: pm8001: Drop !task check in pm8001_abort_task()
  2022-10-26 10:56 [PATCH] scsi: pm8001: Drop !task check in pm8001_abort_task() John Garry
  2022-10-26 10:36 ` Jinpu Wang
  2022-10-27  0:30 ` Damien Le Moal
@ 2022-10-27  2:23 ` Martin K. Petersen
  2022-11-08  4:01 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2022-10-27  2:23 UTC (permalink / raw)
  To: John Garry
  Cc: jinpu.wang, jejb, martin.petersen, linux-scsi, linux-kernel,
	damien.lemoal


John,

> 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.

Applied to 6.2/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: pm8001: Drop !task check in pm8001_abort_task()
  2022-10-26 10:56 [PATCH] scsi: pm8001: Drop !task check in pm8001_abort_task() John Garry
                   ` (2 preceding siblings ...)
  2022-10-27  2:23 ` Martin K. Petersen
@ 2022-11-08  4:01 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2022-11-08  4:01 UTC (permalink / raw)
  To: John Garry, jejb, jinpu.wang
  Cc: Martin K . Petersen, linux-kernel, damien.lemoal, linux-scsi

On Wed, 26 Oct 2022 18:56:04 +0800, John Garry wrote:

> 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.
> 
> [...]

Applied to 6.2/scsi-queue, thanks!

[1/1] scsi: pm8001: Drop !task check in pm8001_abort_task()
      https://git.kernel.org/mkp/scsi/c/4481bdc677c1

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-08  4:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 10:56 [PATCH] scsi: pm8001: Drop !task check in pm8001_abort_task() John Garry
2022-10-26 10:36 ` Jinpu Wang
2022-10-27  0:30 ` Damien Le Moal
2022-10-27  2:23 ` Martin K. Petersen
2022-11-08  4:01 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.