projects
/
platform
/
kernel
/
linux-amlogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
77e69da
)
[PATCH] fix bdev leak in block_dev.c do_open()
author
Al Viro
<viro@zeniv.linux.org.uk>
Fri, 1 Aug 2008 09:32:04 +0000
(
05:32
-0400)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Fri, 1 Aug 2008 15:25:26 +0000
(11:25 -0400)
Callers expect it to drop reference to bdev on all failure exits.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/block_dev.c
patch
|
blob
|
history
diff --git
a/fs/block_dev.c
b/fs/block_dev.c
index
dcf37ca
..
e664b0b
100644
(file)
--- a/
fs/block_dev.c
+++ b/
fs/block_dev.c
@@
-941,8
+941,10
@@
static int do_open(struct block_device *bdev, struct file *file, int for_part)
* hooks: /n/, see "layering violations".
*/
ret = devcgroup_inode_permission(bdev->bd_inode, perm);
- if (ret != 0)
+ if (ret != 0) {
+ bdput(bdev);
return ret;
+ }
ret = -ENXIO;
file->f_mapping = bdev->bd_inode->i_mapping;