Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp495604rwi; Wed, 26 Oct 2022 03:46:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4RlFRWptMyhK2M9QDXP/hZi2+2+KlmGzALvacEwX09o0JotamsZ8HQAvrwWlQzk5dExVv8 X-Received: by 2002:a17:902:ecc2:b0:17f:9022:e00b with SMTP id a2-20020a170902ecc200b0017f9022e00bmr43282541plh.87.1666781162628; Wed, 26 Oct 2022 03:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666781162; cv=none; d=google.com; s=arc-20160816; b=DxJtJ+gLpLN0uJMLTurHzRLiIramgiauVryJcisbTOIG8KjHQ9Hzc1UqTEYj1G3A4l uvjoO0HXiz5MTQ/nb91bwSiV0MjzVR2mQlrYPvZC+7if1IOd/7dedA4HLUAcICselT8k ys4lBqiiqgRZJyG4k2SJtRxeF2dOjmokSzzHcTcAQA6nZ7KqMjOveQRmobKomkso9Y3A z+NgMTil0Pr1HaL88Wv/7iSqX78nL9BGcHuCJfU1EPfaVRI9YG9kyPsXsgzjkRnZeNko 0KA0fM8+7e3eVUYDv7/+Bkli3F9MhCfUfpDPZVHa2lGGpM4zJphc67Z/f44xr5zRS+6r 11DQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020a170903228400b0018678dab05dsi8232293plh.199.2022.10.26.03.45.26; Wed, 26 Oct 2022 03:46:02 -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 + 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 ); 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 To: , , CC: , , , John Garry 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reported-by: Dan Carpenter Signed-off-by: John Garry 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