xfs: use kmem_free to free return value of kmem_zalloc
authorPan Bian <bianpan2016@163.com>
Sun, 17 Sep 2017 21:07:12 +0000 (14:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Sep 2017 06:20:02 +0000 (08:20 +0200)
commit 6c370590cfe0c36bcd62d548148aa65c984540b7 upstream.

In function xfs_test_remount_options(), kfree() is used to free memory
allocated by kmem_zalloc(). But it is better to use kmem_free().

Signed-off-by: Pan Bian <bianpan2016@163.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_super.c

index 882fb85..67d589e 100644 (file)
@@ -1214,7 +1214,7 @@ xfs_test_remount_options(
        tmp_mp->m_super = sb;
        error = xfs_parseargs(tmp_mp, options);
        xfs_free_fsname(tmp_mp);
-       kfree(tmp_mp);
+       kmem_free(tmp_mp);
 
        return error;
 }