On Wed, Sep 28, 2016 at 04:34:37AM -0400, Nayna Jain wrote:
> @@ -323,34 +315,19 @@ static int tpm_bios_measurements_open(struct inode 
> *inode,
>                                           struct file *file)
>  {
>       int err;
> -     struct tpm_bios_log *log;
>       struct seq_file *seq;
> -     const struct seq_operations *seqops =
> -             (const struct seq_operations *)inode->i_private;
> -
> -     log = kzalloc(sizeof(struct tpm_bios_log), GFP_KERNEL);
> -     if (!log)
> -             return -ENOMEM;
> -
> -     err = read_log(log);
> -     if (err)
> -             goto out_free;
> +     const struct tpm_securityfs_data *sfs_data =
> +             (const struct tpm_securityfs_data *)inode->i_private;
> +     const struct seq_operations *seqops = sfs_data->seqops;

You need a get_device(&chip->dev) here, and the matching put_device in 
fops->release().

> +             seq->private = sfs_data->log;

So store the chip here

> +     chip->bin_sfs_data.log = &chip->log;

And pass the chip in here

And other related changes.

Jason

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
tpmdd-devel mailing list
tpmdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to