Message ID | 1538387575-28914-1-git-send-email-miles.chen@mediatek.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [RFC/PATCH] mm/shmem: add a NULL pointer test to shmem_free_inode | expand |
diff --git a/mm/shmem.c b/mm/shmem.c index 4469426..a50a2c8 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -257,7 +257,7 @@ static int shmem_reserve_inode(struct super_block *sb) static void shmem_free_inode(struct super_block *sb) { struct shmem_sb_info *sbinfo = SHMEM_SB(sb); - if (sbinfo->max_inodes) { + if (sbinfo && sbinfo->max_inodes) { spin_lock(&sbinfo->stat_lock); sbinfo->free_inodes++; spin_unlock(&sbinfo->stat_lock);