In the error path for ntfs_attr_map_whole_runlist() the lock is not
released.
Add release for lock.
Detected by Smatch:
fs/ntfs/attrib.c:5197 ntfs_non_resident_attr_collapse_range() warn:
inconsistent returns '&ni->runlist.lock'.
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
down_write(&ni->runlist.lock);
ret = ntfs_attr_map_whole_runlist(ni);
- if (ret)
+ if (ret) {
+ up_write(&ni->runlist.lock);
return ret;
+ }
len = min(len, end_vcn - start_vcn);
for (rl = ni->runlist.rl, dst_cnt = 0; rl && rl->length; rl++)