Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751521AbcJATWI (ORCPT ); Sat, 1 Oct 2016 15:22:08 -0400 Received: from mga11.intel.com ([192.55.52.93]:57394 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750955AbcJATWH (ORCPT ); Sat, 1 Oct 2016 15:22:07 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,428,1473145200"; d="scan'208";a="1064923535" Date: Sat, 1 Oct 2016 22:22:07 +0300 From: Jarkko Sakkinen To: Jason Gunthorpe Cc: Peter Huewe , Nayna Jain , Marcel Selhorst , "moderated list:TPM DEVICE DRIVER" , open list Subject: Re: [PATCH 2/2] tpm: replace dynamically allocated bios_dir with a static array Message-ID: <20161001192207.GA31992@intel.com> References: <1475325678-16573-1-git-send-email-jarkko.sakkinen@linux.intel.com> <1475325678-16573-3-git-send-email-jarkko.sakkinen@linux.intel.com> <20161001164932.GA13462@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161001164932.GA13462@obsidianresearch.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 658 Lines: 18 On Sat, Oct 01, 2016 at 10:49:32AM -0600, Jason Gunthorpe wrote: > On Sat, Oct 01, 2016 at 03:41:17PM +0300, Jarkko Sakkinen wrote: > > - bin_file = > > + chip->bios_dir[cnt] = > > securityfs_create_file("binary_bios_measurements", > > - S_IRUSR | S_IRGRP, tpm_dir, > > + S_IRUSR | S_IRGRP, chip->bios_dir[cnt], > > That is certainly not right, Nayna's version was correct, the function > argument is the directory to create under and bios_dir[0] is setup as the > directory for tpm. This is also why removal is done in reverse order, > files are removed then the directory that contains them. Right. I overlooked this. > Jason /Jarkko