From: Dan Carpenter Date: Sun, 18 Oct 2015 21:42:47 +0000 (+1100) Subject: xfs: fix an error code in xfs_fs_fill_super() X-Git-Tag: v4.14-rc1~4325^2~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9d460b341f23a9bb7df8868975fdfcc2e71aa9b;p=platform%2Fkernel%2Flinux-rpi.git xfs: fix an error code in xfs_fs_fill_super() If alloc_percpu() fails, we accidentally return PTR_ERR(NULL), which means success, but we intended to return -ENOMEM. Fixes: 225e4635580c ('xfs: per-filesystem stats in sysfs') Signed-off-by: Dan Carpenter Reviewed-by: Bill O'Donnell Signed-off-by: Dave Chinner --- diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 368c55a..b2c252c 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1477,7 +1477,7 @@ xfs_fs_fill_super( /* Allocate stats memory before we do operations that might use it */ mp->m_stats.xs_stats = alloc_percpu(struct xfsstats); if (!mp->m_stats.xs_stats) { - error = PTR_ERR(mp->m_stats.xs_stats); + error = -ENOMEM; goto out_destroy_counters; }