| To: | Dave Chinner <david@xxxxxxxxxxxxx>, "Bill O'Donnell" <billodo@xxxxxxxxxx> |
|---|---|
| Subject: | [patch] xfs: fix an error code in xfs_fs_fill_super() |
| From: | Dan Carpenter <dan.carpenter@xxxxxxxxxx> |
| Date: | Thu, 15 Oct 2015 21:19:51 +0300 |
| Cc: | xfs@xxxxxxxxxxx, kernel-janitors@xxxxxxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| User-agent: | Mutt/1.5.23 (2014-03-12) |
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 <dan.carpenter@xxxxxxxxxx>
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;
}
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: linux-next: Tree for Oct 15 (xfs), Randy Dunlap |
|---|---|
| Next by Date: | Re: [patch] xfs: fix an error code in xfs_fs_fill_super(), Bill O'Donnell |
| Previous by Thread: | Re: linux-next: Tree for Oct 15 (xfs), Randy Dunlap |
| Next by Thread: | Re: [patch] xfs: fix an error code in xfs_fs_fill_super(), Bill O'Donnell |
| Indexes: | [Date] [Thread] [Top] [All Lists] |