From: Suresh Jayaraman Date: Wed, 30 Sep 2009 08:53:48 +0000 (+0200) Subject: swapfile: avoid NULL pointer dereference in swapon when s_bdev is NULL X-Git-Tag: v2.6.32-rc3~6^2~11 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bd0f0c763e497c8674b28e3df2732f48683dabd;p=pandora-kernel.git swapfile: avoid NULL pointer dereference in swapon when s_bdev is NULL While testing Swap over NFS patchset, I noticed an oops that was triggered during swapon. Investigating further, the NULL pointer deference is due to the SSD device check/optimization in the swapon code that assumes s_bdev could never be NULL. inode->i_sb->s_bdev could be NULL in a few cases. For e.g. one such case is loopback NFS mount, there could be others as well. Fix this by ensuring s_bdev is not NULL before we try to deference s_bdev. Signed-off-by: Suresh Jayaraman Signed-off-by: Jens Axboe --- Reading git-diff-tree failed