Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100385
b: refs/heads/master
c: 25368ca
h: refs/heads/master
i:
  100383: 28cf387
v: v3
  • Loading branch information
Arnd Bergmann authored and Jonathan Corbet committed Jul 2, 2008
1 parent dd2daa1 commit 633975e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 09de36137c3794786bc75682c0e1ce45182c1772
refs/heads/master: 25368ca579905efe7f7dda43c252eb7b371de98c
5 changes: 5 additions & 0 deletions trunk/drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/poll.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/smp_lock.h>

#include "tpm.h"

Expand Down Expand Up @@ -897,6 +898,7 @@ int tpm_open(struct inode *inode, struct file *file)
int rc = 0, minor = iminor(inode);
struct tpm_chip *chip = NULL, *pos;

lock_kernel();
spin_lock(&driver_lock);

list_for_each_entry(pos, &tpm_chip_list, list) {
Expand Down Expand Up @@ -926,16 +928,19 @@ int tpm_open(struct inode *inode, struct file *file)
if (chip->data_buffer == NULL) {
chip->num_opens--;
put_device(chip->dev);
unlock_kernel();
return -ENOMEM;
}

atomic_set(&chip->data_pending, 0);

file->private_data = chip;
unlock_kernel();
return 0;

err_out:
spin_unlock(&driver_lock);
unlock_kernel();
return rc;
}
EXPORT_SYMBOL_GPL(tpm_open);
Expand Down

0 comments on commit 633975e

Please sign in to comment.