path: root/mm
diff options
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-28 10:21:57 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-28 10:21:57 -0800
commita015d33c98e67e984718ac2a0063a051e30ec548 (patch)
tree374d42ecb0626c18f07475b27d34743b6ffd4978 /mm
parentMerge tag 'xfs-for-linus-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs (diff)
parentmm: shmem: check for mapping owner before dereferencing (diff)
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block layer fixes from Jens Axboe: "Two smaller fixes for this cycle: - A fixup from Keith so that NVMe compiles without BLK_INTEGRITY, basically just moving the code around appropriately. - A fixup for shm, fixing an oops in shmem_mapping() for mapping with no inode. From Sasha" [ The shmem fix doesn't look block-layer-related, but fixes a bug that happened due to the backing_dev_info removal.. - Linus ] * 'for-linus' of git://git.kernel.dk/linux-block: mm: shmem: check for mapping owner before dereferencing NVMe: Fix for BLK_DEV_INTEGRITY not set
Diffstat (limited to 'mm')
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 2f17cb5f00a4..cf2d0ca010bc 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1455,6 +1455,9 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode
bool shmem_mapping(struct address_space *mapping)
+ if (!mapping->host)
+ return false;
return mapping->host->i_sb->s_op == &shmem_ops;