| From stable-bounces@linux.kernel.org Thu Jul 12 22:25:46 2007 |
| From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> |
| Date: Thu, 12 Jul 2007 22:24:52 -0700 |
| Subject: sysfs: release mutex when kmalloc() failed in sysfs_open_file(). |
| To: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> |
| Cc: gregkh@suse.de, linux-kernel@vger.kernel.org, stable@kernel.org |
| Message-ID: <20070712222452.8f14a7db.akpm@linux-foundation.org> |
| |
| |
| From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> |
| |
| |
| |
| Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> |
| |
| |
| --- |
| fs/sysfs/file.c | 1 + |
| 1 file changed, 1 insertion(+) |
| |
| --- a/fs/sysfs/file.c |
| +++ b/fs/sysfs/file.c |
| @@ -283,6 +283,7 @@ static int sysfs_open_file(struct inode |
| mutex_lock(&inode->i_mutex); |
| if (!(set = inode->i_private)) { |
| if (!(set = inode->i_private = kmalloc(sizeof(struct sysfs_buffer_collection), GFP_KERNEL))) { |
| + mutex_unlock(&inode->i_mutex); |
| error = -ENOMEM; |
| goto Done; |
| } else { |