aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-09-09 22:27:33 -0700
committerDavid S. Miller <davem@davemloft.net>2010-09-09 22:27:33 -0700
commite548833df83c3554229eff0672900bfe958b45fd (patch)
tree85efc4a76dc356593d6d394776aeb845dc580fb6 /mm/shmem.c
parentdrivers/net/bnx2x: use ARRAY_SIZE macro in bnx2x_main.c (diff)
parentMerge branch 'vhost-net' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost (diff)
downloadlinux-dev-e548833df83c3554229eff0672900bfe958b45fd.tar.xz
linux-dev-e548833df83c3554229eff0672900bfe958b45fd.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: net/mac80211/main.c
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index dfaa0f4e9789..080b09a57a8f 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2325,7 +2325,10 @@ static int shmem_show_options(struct seq_file *seq, struct vfsmount *vfs)
static void shmem_put_super(struct super_block *sb)
{
- kfree(sb->s_fs_info);
+ struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
+
+ percpu_counter_destroy(&sbinfo->used_blocks);
+ kfree(sbinfo);
sb->s_fs_info = NULL;
}
@@ -2367,7 +2370,8 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
#endif
spin_lock_init(&sbinfo->stat_lock);
- percpu_counter_init(&sbinfo->used_blocks, 0);
+ if (percpu_counter_init(&sbinfo->used_blocks, 0))
+ goto failed;
sbinfo->free_inodes = sbinfo->max_inodes;
sb->s_maxbytes = SHMEM_MAX_BYTES;