Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2563765lkm; Mon, 20 Sep 2021 18:49:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ3/q8DF8EB/CXQQSPjq/Btazw3YowGt8BgVrllgB79UiTOIrgCGxpM7Bo97viV1AJKjTR X-Received: by 2002:a6b:6a08:: with SMTP id x8mr6684980iog.89.1632188876841; Mon, 20 Sep 2021 18:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188876; cv=none; d=google.com; s=arc-20160816; b=hQ7jes9tUBUUZ1Z8Pqx6chlh42dSt+6EW+zlp4hCo1oXnA31idhEf1ZCaLHdVYPOEh pZlf+GlB0+PJrXFVrD+4BAzRiyiYU4b7XZ/UjJOvJBY3wxWOLFg/+OOr7KHPvDD/v19Y BX1fkONUCyEyS3rTsCk7ALFxM32JZX7d+gP6HUB5+kve4jqBikWuMWk7Zl0xKiiFppPc e6TGfxPi1AWVjqrTuwlXjAPSvlsZUP/kqOiTkzF09I/AVsrfzNhZPhqNGlEC/f0f2m6Y BbDdu82Nf7rS8a/zxuPqH5c1xcXr3nsqeHubC7DHT6ZFy9zgYcIBhp0ME0JWqV4QGnLh 06Tg== 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=I1bpKdYirGZmiCbfuMe9bNDkUWHF5Au4zXOQ9km3VA0=; b=FfFdiSTG5UWIsuHwfDIYXs/VLfWF5G3ViyyAkM3i5z5bQiFeCzgVSo7owZNjOvryQw zldRK2AGnHlkiDSMEAbvuIVqIyud0MPhDnCAz+DyzxRzkYeJaVd2rGL+R6Hez7u8H2RT u/tzJx4ur8DCZKt1SEAYmsNQ+c8lkVbVp/F6NCO5D6ayBYDJIX1M2sfw6dBonN2Yifua fnM+jBoc75QNqYqAgzu/m3XfIkwrScMY5Ksx54H7u8p5Gsf0M+Ik9G2FSLuX3zVrVR84 mz8b+PAw6virjurJJtkmbf/42h9RXaC2/rSpNJm6r98oQIbTXo6/SgkCwrN1SEBiPpej 5DxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aKPbfTJk; 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 g19si9222508jam.54.2021.09.20.18.47.45; Mon, 20 Sep 2021 18:47:56 -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=aKPbfTJk; 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 S1348649AbhITRhU (ORCPT + 99 others); Mon, 20 Sep 2021 13:37:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:36662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351734AbhITRes (ORCPT ); Mon, 20 Sep 2021 13:34:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A7DA061B1D; Mon, 20 Sep 2021 17:05:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157557; bh=oTBW6XUuhknbqKs+Jvdfwrz8zVlzu29Nj5RUC1hNxZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aKPbfTJkIyvtl9Gi/t9BfVPi0YBXZ7xn9C6zxbjjZF9VI00tWsKnL0q/TVlKznKtb k10rFqnfJryZ2Vv9i0KaBwEAfbKfOBnP+ytqDj4iXgFpd/O3l0BQpeEuA92ROnnFhQ SQcST0c5LvdGpwSAOZTBefJSQgCFMK/aqaYEK12k= 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.19 046/293] libata: fix ata_host_start() Date: Mon, 20 Sep 2021 18:40:08 +0200 Message-Id: <20210920163934.838787604@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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 db1d86af21b4..d9b1c3e95592 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6412,7 +6412,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