[PATCH 2/2] fs: logfs NULL pointer check added

From: Abhijit Pawar
Date: Tue Nov 27 2012 - 06:26:07 EST


This patches fixes the case where the NULL inode may be passed to get the page for writing.

Signed-off-by: Abhijit Pawar <abhi.c.pawar@xxxxxxxxx>
---
fs/logfs/readwrite.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c
index 53596ce..55b45fb 100644
--- a/fs/logfs/readwrite.c
+++ b/fs/logfs/readwrite.c
@@ -2201,6 +2201,7 @@ void btree_write_block(struct logfs_block *block)
int err, cookie;

inode = logfs_safe_iget(block->sb, block->ino, &cookie);
+ BUG_ON(!inode);
page = logfs_get_write_page(inode, block->bix, block->level);
BUG_ON(!page);

--
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/