diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index 7446bf09a04a..5e26a4f3edeb 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -743,6 +743,11 @@ struct exfat_dentry *exfat_get_dentry_cached( { int off = es->start_off + num * DENTRY_SIZE; struct buffer_head *bh = es->bh[EXFAT_B_TO_BLK(off, es->sb)]; + + if(!bh || !bh->data) { + printk(KERN_ERR "invalid buffer head (or) b_data is NULL\n"); + return NULL; + } char *p = bh->b_data + EXFAT_BLK_OFFSET(off, es->sb); return (struct exfat_dentry *)p;