Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19337
b: refs/heads/master
c: ca4a031
h: refs/heads/master
i:
  19335: 178231a
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Feb 1, 2006
1 parent 16fbae2 commit c54dc29
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ed5a92700d3ce2646cb7763792a5f7ad1bade7e8
refs/heads/master: ca4a031f6b43edb8745ebc0a1b7307c24719dae4
15 changes: 12 additions & 3 deletions trunk/drivers/char/tpm/tpm_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,26 +487,35 @@ struct file_operations tpm_binary_bios_measurements_ops = {
.release = tpm_bios_measurements_release,
};

static int is_bad(void *p)
{
if (!p)
return 1;
if (IS_ERR(p) && (PTR_ERR(p) != -ENODEV))
return 1;
return 0;
}

struct dentry **tpm_bios_log_setup(char *name)
{
struct dentry **ret = NULL, *tpm_dir, *bin_file, *ascii_file;

tpm_dir = securityfs_create_dir(name, NULL);
if (!tpm_dir)
if (is_bad(tpm_dir))
goto out;

bin_file =
securityfs_create_file("binary_bios_measurements",
S_IRUSR | S_IRGRP, tpm_dir, NULL,
&tpm_binary_bios_measurements_ops);
if (!bin_file)
if (is_bad(bin_file))
goto out_tpm;

ascii_file =
securityfs_create_file("ascii_bios_measurements",
S_IRUSR | S_IRGRP, tpm_dir, NULL,
&tpm_ascii_bios_measurements_ops);
if (!ascii_file)
if (is_bad(ascii_file))
goto out_bin;

ret = kmalloc(3 * sizeof(struct dentry *), GFP_KERNEL);
Expand Down

0 comments on commit c54dc29

Please sign in to comment.