diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/fs/namei.c b/fs/namei.c index 183a769537fe..4bc4bc6a6938 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2305,22 +2305,15 @@ static struct file *atomic_open(struct nameidata *nd, struct dentry *dentry, | |||
2305 | * here. | 2305 | * here. |
2306 | */ | 2306 | */ |
2307 | error = may_open(&filp->f_path, acc_mode, open_flag); | 2307 | error = may_open(&filp->f_path, acc_mode, open_flag); |
2308 | if (error) | 2308 | if (error) { |
2309 | goto out_fput; | 2309 | fput(filp); |
2310 | 2310 | filp = ERR_PTR(error); | |
2311 | error = open_check_o_direct(filp); | 2311 | } |
2312 | if (error) | ||
2313 | goto out_fput; | ||
2314 | 2312 | ||
2315 | out: | 2313 | out: |
2316 | dput(dentry); | 2314 | dput(dentry); |
2317 | return filp; | 2315 | return filp; |
2318 | 2316 | ||
2319 | out_fput: | ||
2320 | fput(filp); | ||
2321 | filp = ERR_PTR(error); | ||
2322 | goto out; | ||
2323 | |||
2324 | no_open: | 2317 | no_open: |
2325 | if (need_lookup) { | 2318 | if (need_lookup) { |
2326 | dentry = lookup_real(dir, dentry, nd); | 2319 | dentry = lookup_real(dir, dentry, nd); |
@@ -2619,10 +2612,10 @@ finish_open_created: | |||
2619 | goto stale_open; | 2612 | goto stale_open; |
2620 | goto out; | 2613 | goto out; |
2621 | } | 2614 | } |
2615 | opened: | ||
2622 | error = open_check_o_direct(filp); | 2616 | error = open_check_o_direct(filp); |
2623 | if (error) | 2617 | if (error) |
2624 | goto exit_fput; | 2618 | goto exit_fput; |
2625 | opened: | ||
2626 | error = ima_file_check(filp, op->acc_mode); | 2619 | error = ima_file_check(filp, op->acc_mode); |
2627 | if (error) | 2620 | if (error) |
2628 | goto exit_fput; | 2621 | goto exit_fput; |