On 7/20/07, Reiner Sailer <sailer@xxxxxxxxxx> wrote:===>
>
> Jesper Juhl <jesper.juhl@xxxxxxxxx> wrote on 07/18/2007 07:11:54 PM:
> >
> > +++ b/drivers/char/tpm/tpm_bios.c
> > @@ -427,7 +427,7 @@ static int
> > tpm_ascii_bios_measurements_open(struct inode *inode,
> > return -ENOMEM;
> >
> > if ((err = read_log(log)))
> > - return err;
> > + goto out_free;
> >
> > /* now register seq file */
> > err = seq_open(file, &tpm_ascii_b_measurments_seqops);
> > @@ -435,10 +435,15 @@ static int
> > tpm_ascii_bios_measurements_open(struct inode *inode,
> > seq = file->private_data;
> > seq->private = log;
> > } else {
> > - kfree(log->bios_event_log);
> > - kfree(log);
> > + goto out_free;
> > }
> > +
> > +out:
> > return err;
> > +out_free:
> > + kfree(log->bios_event_log);
> > + kfree(log);
> > + goto out;
> > }
> >