On 5 October 2006 14:50, Eric Sesterhenn wrote:
> hi,
>
> coverity spotted another dereference in the reiser code,
> which i am able to verify, but not sure how to fix:
>
>
> 1305 bh = sb_bread(sb, block);
> 1306 if (bh == NULL)
> 1307 reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%lu) "
> 1308 "reading failed", __FUNCTION__,
> bh->b_blocknr);
Thanks Eric
> if bh is NULL, we dereference it in the warning as bh->b_blocknr.
> Maybe one of you guys knows what warning is useful to print in this
> case and can cook up a patch for this.
From: Eric Eric Sesterhenn <[EMAIL PROTECTED]>
null pointer dereferencing in reiserfs_read_bitmap_block.
Signed-off-by: Alexander Zarochentsev <[EMAIL PROTECTED]>
---
fs/reiserfs/bitmap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- linux.orig/fs/reiserfs/bitmap.c
+++ linux/fs/reiserfs/bitmap.c
@@ -1304,8 +1304,8 @@ struct buffer_head *reiserfs_read_bitmap
bh = sb_bread(sb, block);
if (bh == NULL)
- reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%lu) "
- "reading failed", __FUNCTION__, bh->b_blocknr);
+ reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%u) "
+ "reading failed", __FUNCTION__, block);
else {
if (buffer_locked(bh)) {
PROC_INFO_INC(sb, scan_bitmap.wait);
--
Alex.