Message ID | 1666781764-123090-1-git-send-email-john.garry@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp179738wru; Wed, 26 Oct 2022 03:39:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6pwPYIsyWb5YWvRWqrcFh5ORnlbtYf5orm0N4YG30N8rCvUCf9tq9t1Q31AT8bUM3OPr8d X-Received: by 2002:a05:6a00:194e:b0:566:5da:ea67 with SMTP id s14-20020a056a00194e00b0056605daea67mr44475946pfk.77.1666780741431; Wed, 26 Oct 2022 03:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666780741; cv=none; d=google.com; s=arc-20160816; b=JDtv36Oewzmib6zlPT9mPNji8l+ViClazYTgmPwmbqAQ5l4tjLimsOyvI2OPSO3hsL 72UeRGvli4pucVTQhADV/ZOsSVmFPaSVH5PSO95KYs7PJh5RT+oUPO58EVUp1gc57jms L93yCAMj4P19H9Z5A/AVUsWAGtUFfjIP+7BFM6BKrGobmb6e9pKgfXcAYFKr8tePPVG6 zV4DUBazVS2h1VGJNXD+8xyJIBm/qALPlCppkDE/xQPxlr+146tgZxY2JvZbgJ6dAzyU S3GB6OcKd4bS4eUZfb7LYfLZhWETailcqwZIm6z9OPDf2/d06Iuub/3JXnZVIq+iiyjm h+Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=0VNgz1AA93b4CQcMP1BymxCvRRyP1tcZwWbuKjVF66o=; b=lG+KUmOsT3q45t4lNPDDwJd5+JZAw05SugCkIGsNAaoTwFtNH8rz4NzubcHdW0k4NI LLHnXCNSEYG9XpRSto8fYNrOkoCT/7t7qA+wzOlcYAv32SLKGx82cXK3llLLVF10FOS5 q/3CVjyCjCV2ko4qteuVTTz5vyTIeAbNaTzhITUxYMBmBkK39MdsZ0P7R9LY8s3XRs/y 5ChlptxNXrThecxlibs9nSeet00QCHTOSqWqTNYkYqvsecncZYFNMeIn3S1W7qsbswzV XgcwSnaW7qUgg+EcbQTm2GxLHE6lZlL5Ix9zkSbUgW+FIzuhm+xR+cMkQnvLi2EjagqK SfzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t185-20020a6381c2000000b0044d470e823fsi6396460pgd.327.2022.10.26.03.38.47; Wed, 26 Oct 2022 03:39:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232946AbiJZKZh (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Wed, 26 Oct 2022 06:25:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233355AbiJZKZd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Oct 2022 06:25:33 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46F2932AB5; Wed, 26 Oct 2022 03:25:30 -0700 (PDT) Received: from fraeml742-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4My4fX67NBz685ZG; Wed, 26 Oct 2022 18:24:04 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml742-chm.china.huawei.com (10.206.15.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 26 Oct 2022 12:25:28 +0200 Received: from localhost.localdomain (10.69.192.58) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 26 Oct 2022 11:25:26 +0100 From: John Garry <john.garry@huawei.com> To: <jinpu.wang@cloud.ionos.com>, <jejb@linux.ibm.com>, <martin.petersen@oracle.com> CC: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <damien.lemoal@opensource.wdc.com>, John Garry <john.garry@huawei.com> Subject: [PATCH] scsi: pm8001: Drop !task check in pm8001_abort_task() Date: Wed, 26 Oct 2022 18:56:04 +0800 Message-ID: <1666781764-123090-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747746282751661226?= X-GMAIL-MSGID: =?utf-8?q?1747746282751661226?= |
Series |
scsi: pm8001: Drop !task check in pm8001_abort_task()
|
|
Commit Message
John Garry
Oct. 26, 2022, 10:56 a.m. UTC
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>
Comments
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 >
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>
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!
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
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;