Commit f9d460b3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dave Chinner

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: 225e4635 ('xfs: per-filesystem stats in sysfs')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarBill O'Donnell <billodo@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 985ef4dc
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment