Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2318782pxb; Mon, 20 Sep 2021 18:41:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+RICBFnvWN/rDHypyipMD2NqUuNRkjqrxcDHMA5dWvoHb/EPFnxECKhUQf3pTdAhA2MBX X-Received: by 2002:a02:cbde:: with SMTP id u30mr16527992jaq.102.1632188474270; Mon, 20 Sep 2021 18:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188474; cv=none; d=google.com; s=arc-20160816; b=xliqKwFSFG70LmiTc1cT5hvsPuRLLl25P/fo3D3T6/siht/t7PEe663Xw5q7/HKqqy 12c/IhFRpqOUhJFhglJmMWEeFZszT30cvTpSm8Tp6ISrJSi2XX4k4ayfL9EroWnmmCov HNyqw7ngNkOHE36O3xIgMeKIc/8ox7rHCAfKN5mM50a2neIdSJbEM1bxeygVrwUAKWB4 WHxXWel5vbS5cCVT3MkpyTiziXKfB8AQME4iwMCv5wbiNVsozMK5ihy4/5NryYVdjSAF DBAT6k0nxe7uXS87suX95uE3J/cIRd4SlMA4Dfy7ZiGdJpigfWuHyuuhRSh/H/ryc5jO +PiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jGEYt/l61iggUo1LCTHEdfqvt5GtVg7ZyyIBMy1FiEQ=; b=Jj2Bc35GhRuTNPMkJ2kuHBCSio9vOgxLGPNJkt3qWI/r8mbBXdvAmkiDC/+iFkKaYa 7l8S1kaUgU35nE2rb0JkCSmmaQDv7yQpnu0KsNu+yuwcOWrLab/QpWSnIJeQgFlR1/vf teE03sjMN8fplw6xCgwde5WQUmib1iOxt/8VUSDNRpcnFHdGUEFctf6QMrKutgnihdih jVlGIkNpLZyDoqyxQvmkZTNWYQHMFDAhhXr2J84Box4CW5V+X6cI9XIgqx+BuajG2W9f q99SdKIxKBCABPG+rgB8ajKcgwQzRBmb2ew1RZJcMcT/ci2SRScgqUbcf2cnt2VHBqhH W++Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tslThNvh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si2715677ilg.173.2021.09.20.18.41.03; Mon, 20 Sep 2021 18:41:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tslThNvh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240625AbhITQsY (ORCPT + 99 others); Mon, 20 Sep 2021 12:48:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:35714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243296AbhITQrp (ORCPT ); Mon, 20 Sep 2021 12:47:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E4857611C2; Mon, 20 Sep 2021 16:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156378; bh=z8Ja/ElGQ1hi6wVdgeJUHNWkMXKfTp5otZ9tFjR3EkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tslThNvhz6vELHHAeBcmrnss+ioMpbPw5Y/CJeQs/zE/j4LXLl1Z/hF87qM7k8dkF 0ctw90ohL/xA7+OVlARD0zpfcO44ulV6tgXRaZLLBW2ZsJdy/DopjSFvkroT0ozUv1 cx7qb6li74e6oo/KYBaiJ8wucFiF0LrB2wsbwCLc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Damien Le Moal , Hannes Reinecke , Jens Axboe , Sasha Levin Subject: [PATCH 4.4 032/133] libata: fix ata_host_start() Date: Mon, 20 Sep 2021 18:41:50 +0200 Message-Id: <20210920163913.674679894@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Damien Le Moal [ Upstream commit 355a8031dc174450ccad2a61c513ad7222d87a97 ] The loop on entry of ata_host_start() may not initialize host->ops to a non NULL value. The test on the host_stop field of host->ops must then be preceded by a check that host->ops is not NULL. Reported-by: kernel test robot Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210816014456.2191776-3-damien.lemoal@wdc.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/ata/libata-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 8ed3f6d75ff1..2ece0a65ccee 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6026,7 +6026,7 @@ int ata_host_start(struct ata_host *host) have_stop = 1; } - if (host->ops->host_stop) + if (host->ops && host->ops->host_stop) have_stop = 1; if (have_stop) { -- 2.30.2