User: | Jiri Slaby |
Error type: | Leaving function in locked state |
Error type description: | Some lock is not unlocked on all paths of a function, so it is leaked |
File location: | fs/namei.c |
Line in file: | 1734 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
|
Entered: | 2012-03-02 21:35:18 UTC |
1704 error = PTR_ERR(path.dentry); 1705 if (IS_ERR(path.dentry)) { 1706 mutex_unlock(&dir->d_inode->i_mutex); 1707 goto exit; 1708 } 1709 1710 if (IS_ERR(nd.intent.open.file)) { 1711 error = PTR_ERR(nd.intent.open.file); 1712 goto exit_mutex_unlock; 1713 } 1714 1715 /* Negative dentry, just create the file */ 1716 if (!path.dentry->d_inode) { 1717 /* 1718 * This write is needed to ensure that a 1719 * ro->rw transition does not occur between 1720 * the time when the file is created and when 1721 * a permanent write count is taken through 1722 * the 'struct file' in nameidata_to_filp(). 1723 */ 1724 error = mnt_want_write(nd.path.mnt); 1725 if (error) 1726 goto exit_mutex_unlock; 1727 error = __open_namei_create(&nd, &path, flag, mode); 1728 if (error) { 1729 mnt_drop_write(nd.path.mnt); 1730 goto exit; 1731 } 1732 filp = nameidata_to_filp(&nd, open_flag); 1733 mnt_drop_write(nd.path.mnt); 1734 return filp; 1735 } 1736 1737 /* 1738 * It already exists. 1739 */ 1740 mutex_unlock(&dir->d_inode->i_mutex); 1741 audit_inode(pathname, path.dentry); 1742 1743 error = -EEXIST; 1744 if (flag & O_EXCL)