From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH 2/2] tpm: replace dynamically allocated bios_dir with a static array Date: Sat, 1 Oct 2016 10:49:32 -0600 Message-ID: <20161001164932.GA13462@obsidianresearch.com> References: <1475325678-16573-1-git-send-email-jarkko.sakkinen@linux.intel.com> <1475325678-16573-3-git-send-email-jarkko.sakkinen@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1475325678-16573-3-git-send-email-jarkko.sakkinen@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Jarkko Sakkinen Cc: Peter Huewe , Nayna Jain , Marcel Selhorst , "moderated list:TPM DEVICE DRIVER" , open list List-Id: tpmdd-devel@lists.sourceforge.net 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. Jason