From patchwork Fri Aug 6 11:11:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1514292 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=hPlKBo/6; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4Gh2qc1Fx8z9sRR for ; Fri, 6 Aug 2021 21:11:56 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245336AbhHFLMK (ORCPT ); Fri, 6 Aug 2021 07:12:10 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:47118 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232079AbhHFLMH (ORCPT ); Fri, 6 Aug 2021 07:12:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1628248313; x=1659784313; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uUZ1+YSkY07S1sOnW9DMCk0sb8DSqpYgvgs5GZz3c34=; b=hPlKBo/6Od7CbghNo3sqXDU2vxczim+9iWKZTenXWO800VGUHm3DUBCM t2O1HyK6AOKESDVEE5vHLSaGuhjoFbdJA0YryD7usVVhmQwhpJahnF901 iR8e/GRt1SsyQzWILfCF4OeSqMHWko8VMaueGi1JV8mzTacMWke6daaUt ACrisa22m8wD4fK7jct55MfvVIIq2apOVCRskpydy4/qh/zDQfUigXt2r UNxaNWXg8pYd1h0Lno2BpP5lECp9wIVI/rUwpkXrHpKUsfhOSHSmi2fa1 w5WJxKynAqNCW93fMmbC8UOL4wdIbg6SzJZbF1T6S9O/TfzFegGUYxG4l w==; X-IronPort-AV: E=Sophos;i="5.84,300,1620662400"; d="scan'208";a="177055542" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 06 Aug 2021 19:11:53 +0800 IronPort-SDR: OCHyHL7fk+QXyt4f9WbHAmqSAtFxrwlg31L/EZgHOtuTwHgUF8QA7N2BzLjvCShj7dmsWbAOd8 8gEBfxJPw1Tfe7r3jrlqUEKxvZzUpdLsUmHoVebSvfaR/4sC8pIiITCduDvryvYPvqAbriWlby s+t+KvJhN1zjdJ0/zEv/WDk7thSwI0h0KvKxv7XLIaQ7h4nQ3NldZODTLdeUSkLv/DvpqWNwJD IADfziuNnTnA90bzHsCwCZ2oE5sIVKW5ZuPX63zx/go/KdEd2v5JX7x+ijjuQ19E3s+0VfMktA BDvWCxGHQn/i/siZU9l6XMhA Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2021 03:47:28 -0700 IronPort-SDR: 7P/QsreECFL24yf6c16ivDSqmJDfjQVSO6xjp8HBcTljsoUGnCfjLivyCcvwiEcpZ1NEkcdugM mwuHgrnsQUnkM/nb0FdhqXdQT4EkVBh6Wg2zyI3zKmC4fCshes71+QISy7jaevXvyzDS29gE2j v8St3UDekvsavAQIZXi6ZvKMWy4SkItJs2+3cNUCAC69U4jdFcHWdVE+pW22ombYTydhbBX/kn n+gEG00Mf2FAnpUmAqApdPiJseQRkQQFgDtgWgWboVjzN3pB7M0jdgUG+qE4SPjmiumyoTwlPC qOI= WDCIronportException: Internal Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by uls-op-cesaip02.wdc.com with ESMTP; 06 Aug 2021 04:11:51 -0700 From: Damien Le Moal To: Jens Axboe , linux-block@vger.kernel.org, linux-ide@vger.kernel.org, "Martin K . Petersen" , linux-scsi@vger.kernel.org Cc: Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani Subject: [PATCH v3 2/9] libata: fix ata_host_start() Date: Fri, 6 Aug 2021 20:11:38 +0900 Message-Id: <20210806111145.445697-3-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806111145.445697-1-damien.lemoal@wdc.com> References: <20210806111145.445697-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org 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 --- 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 ea8b91297f12..fe49197caf99 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -5573,7 +5573,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) {