Unified · Split
| @@ -970,7 +970,7 @@ static int _nfs4_do_open(struct inode *dir, struct dentry *dentry, int flags, st · 969 unmodified lines | ||
| 970 | 970 | status = -ENOMEM; |
| 971 | 971 | opendata = nfs4_opendata_alloc(dentry, sp, flags, sattr); |
| 972 | 972 | if (opendata == NULL) |
| 973 | − goto err_put_state_owner; | |
| 973 | + goto err_release_rwsem; | |
| 974 | 974 | |
| 975 | 975 | status = _nfs4_proc_open(opendata); |
| 976 | 976 | if (status != 0) |
| @@ -989,11 +989,11 @@ static int _nfs4_do_open(struct inode *dir, struct dentry *dentry, int flags, st · 12 unmodified lines | ||
| 989 | 989 | return 0; |
| 990 | 990 | err_opendata_free: |
| 991 | 991 | nfs4_opendata_free(opendata); |
| 992 | +err_release_rwsem: | |
| 993 | + up_read(&clp->cl_sem); | |
| 992 | 994 | err_put_state_owner: |
| 993 | 995 | nfs4_put_state_owner(sp); |
| 994 | 996 | out_err: |
| 995 | − /* Note: clp->cl_sem must be released before nfs4_put_open_state()! */ | |
| 996 | − up_read(&clp->cl_sem); | |
| 997 | 997 | *res = NULL; |
| 998 | 998 | return status; |
| 999 | 999 | } |