ocfs2: fix panic on kfree(xattr->name)
authorTetsuo Handa <[email protected]>
Thu, 3 Apr 2014 21:47:07 +0000 (14:47 -0700)
committerLinus Torvalds <[email protected]>
Thu, 3 Apr 2014 23:20:56 +0000 (16:20 -0700)
Commit 9548906b2bb7 ('xattr: Constify ->name member of "struct xattr"')
missed that ocfs2 is calling kfree(xattr->name).  As a result, kernel
panic occurs upon calling kfree(xattr->name) because xattr->name refers
static constant names.  This patch removes kfree(xattr->name) from
ocfs2_mknod() and ocfs2_symlink().

Signed-off-by: Tetsuo Handa <[email protected]>
Reported-by: Tariq Saeed <[email protected]>
Tested-by: Tariq Saeed <[email protected]>
Reviewed-by: Srinivas Eeda <[email protected]>
Cc: Joel Becker <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: <[email protected]> [3.12+]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/ocfs2/namei.c

index 931fd50a971ff40a8cf50488c624807a6c27904a..4a797f22239d9a4e717c205a5a48a1db8300695a 100644 (file)
@@ -450,7 +450,6 @@ leave:
 
        brelse(new_fe_bh);
        brelse(parent_fe_bh);
-       kfree(si.name);
        kfree(si.value);
 
        ocfs2_free_dir_lookup_result(&lookup);
@@ -1856,7 +1855,6 @@ bail:
 
        brelse(new_fe_bh);
        brelse(parent_fe_bh);
-       kfree(si.name);
        kfree(si.value);
        ocfs2_free_dir_lookup_result(&lookup);
        if (inode_ac)