projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b4e7a7a
)
cxl_getfile(): fix double-iput() on alloc_file() failures
author
Al Viro
<
[email protected]
>
Sat, 9 Jun 2018 13:43:13 +0000
(09:43 -0400)
committer
Al Viro
<
[email protected]
>
Wed, 11 Jul 2018 03:29:03 +0000
(23:29 -0400)
Doing iput() after path_put() is wrong.
Cc:
[email protected]
Acked-by: Linus Torvalds <
[email protected]
>
Signed-off-by: Al Viro <
[email protected]
>
drivers/misc/cxl/api.c
patch
|
blob
|
history
diff --git
a/drivers/misc/cxl/api.c
b/drivers/misc/cxl/api.c
index 753b1a698fc4e3ef74a7ebb718a1997ae8a13a4d..6b16946f9b05d45ea3372f955d12151bb2782cfd 100644
(file)
--- a/
drivers/misc/cxl/api.c
+++ b/
drivers/misc/cxl/api.c
@@
-103,15
+103,15
@@
static struct file *cxl_getfile(const char *name,
d_instantiate(path.dentry, inode);
file = alloc_file(&path, OPEN_FMODE(flags), fops);
- if (IS_ERR(file))
- goto err_dput;
+ if (IS_ERR(file)) {
+ path_put(&path);
+ goto err_fs;
+ }
file->f_flags = flags & (O_ACCMODE | O_NONBLOCK);
file->private_data = priv;
return file;
-err_dput:
- path_put(&path);
err_inode:
iput(inode);
err_fs: