Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754140AbbLRQvd (ORCPT ); Fri, 18 Dec 2015 11:51:33 -0500 Received: from quartz.orcorp.ca ([184.70.90.242]:56946 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753221AbbLRQvc (ORCPT ); Fri, 18 Dec 2015 11:51:32 -0500 Date: Fri, 18 Dec 2015 09:51:27 -0700 From: Jason Gunthorpe To: Jarkko Sakkinen Cc: g@intel.com, tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Martin Wilck , Peter Huewe , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH v3 3/7] tpm_tis: Do not fall back to a hardcoded address for TPM2 Message-ID: <20151218165127.GC7354@obsidianresearch.com> References: <1450376600-6970-1-git-send-email-jgunthorpe@obsidianresearch.com> <1450376600-6970-4-git-send-email-jgunthorpe@obsidianresearch.com> <20151218093432.GA10581@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151218093432.GA10581@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.160 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1445 Lines: 40 On Fri, Dec 18, 2015 at 11:34:32AM +0200, Jarkko Sakkinen wrote: > > + st = acpi_get_table(ACPI_SIG_TPM2, 1, > > + (struct acpi_table_header **) &tbl); > > + if (ACPI_FAILURE(st) || tbl->header.length < sizeof(*tbl)) { > > + dev_err(&acpi_dev->dev, > > + FW_BUG "failed to get TPM2 ACPI table\n"); > > + return -EINVAL; > > + } > > + > > + if (tbl->start_method != ACPI_TPM2_MEMORY_MAPPED) > > return -ENODEV; > > > > INIT_LIST_HEAD(&resources); > > @@ -996,6 +978,12 @@ static int tpm_tis_acpi_init(struct acpi_device *acpi_dev) > > > > acpi_dev_free_resource_list(&resources); > > > > + if (tpm_info.start == 0 && tpm_info.len == 0) { > > + dev_err(&acpi_dev->dev, > > + FW_BUG "TPM2 ACPI table does not define a memory resource\n"); > > + return -EINVAL; > > + } > > + > > I guess this the only relevant change in this patch? You should propose > removal of is_fifo() as a separate patch if that makes sense. This patch > is now doing orthogonal things. No, the return code changes are relevant too, and are why is_fifo was best un-inlined. The patch is fixing all the ACPI data validatation in one go, not just the resource range, the description notes this. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/