diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/hppfs/hppfs.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c index 126d3c2e2dee..8ef57793c923 100644 --- a/fs/hppfs/hppfs.c +++ b/fs/hppfs/hppfs.c | |||
| @@ -436,7 +436,6 @@ static int hppfs_open(struct inode *inode, struct file *file) | |||
| 436 | path.mnt = inode->i_sb->s_fs_info; | 436 | path.mnt = inode->i_sb->s_fs_info; |
| 437 | path.dentry = HPPFS_I(inode)->proc_dentry; | 437 | path.dentry = HPPFS_I(inode)->proc_dentry; |
| 438 | 438 | ||
| 439 | /* XXX This isn't closed anywhere */ | ||
| 440 | data->proc_file = dentry_open(&path, file_mode(file->f_mode), cred); | 439 | data->proc_file = dentry_open(&path, file_mode(file->f_mode), cred); |
| 441 | err = PTR_ERR(data->proc_file); | 440 | err = PTR_ERR(data->proc_file); |
| 442 | if (IS_ERR(data->proc_file)) | 441 | if (IS_ERR(data->proc_file)) |
| @@ -523,12 +522,23 @@ static loff_t hppfs_llseek(struct file *file, loff_t off, int where) | |||
| 523 | return default_llseek(file, off, where); | 522 | return default_llseek(file, off, where); |
| 524 | } | 523 | } |
| 525 | 524 | ||
| 525 | static int hppfs_release(struct inode *inode, struct file *file) | ||
| 526 | { | ||
| 527 | struct hppfs_private *data = file->private_data; | ||
| 528 | struct file *proc_file = data->proc_file; | ||
| 529 | if (proc_file) | ||
| 530 | fput(proc_file); | ||
| 531 | kfree(data); | ||
| 532 | return 0; | ||
| 533 | } | ||
| 534 | |||
| 526 | static const struct file_operations hppfs_file_fops = { | 535 | static const struct file_operations hppfs_file_fops = { |
| 527 | .owner = NULL, | 536 | .owner = NULL, |
| 528 | .llseek = hppfs_llseek, | 537 | .llseek = hppfs_llseek, |
| 529 | .read = hppfs_read, | 538 | .read = hppfs_read, |
| 530 | .write = hppfs_write, | 539 | .write = hppfs_write, |
| 531 | .open = hppfs_open, | 540 | .open = hppfs_open, |
| 541 | .release = hppfs_release, | ||
| 532 | }; | 542 | }; |
| 533 | 543 | ||
| 534 | struct hppfs_dirent { | 544 | struct hppfs_dirent { |
| @@ -582,6 +592,7 @@ static const struct file_operations hppfs_dir_fops = { | |||
| 582 | .open = hppfs_dir_open, | 592 | .open = hppfs_dir_open, |
| 583 | .fsync = hppfs_fsync, | 593 | .fsync = hppfs_fsync, |
| 584 | .llseek = default_llseek, | 594 | .llseek = default_llseek, |
| 595 | .release = hppfs_release, | ||
| 585 | }; | 596 | }; |
| 586 | 597 | ||
| 587 | static int hppfs_statfs(struct dentry *dentry, struct kstatfs *sf) | 598 | static int hppfs_statfs(struct dentry *dentry, struct kstatfs *sf) |
