From patchwork Wed Oct 26 10:56:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 619453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E5C5FA3740 for ; Wed, 26 Oct 2022 10:25:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233392AbiJZKZf (ORCPT ); Wed, 26 Oct 2022 06:25:35 -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 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 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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;