Skip to contentSkip to conversation

ext4: Fix Null dereference.

PATCH New Aneesh Kumar K.V 1 participant 1 message Feb 4, 2008 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: Fix Null dereference.

Repoted by Adrian Bunk <[email protected]>:

The Coverity checker spotted the following NULL dereference:

static int ext4_mb_mark_diskspace_used

{
	...
	if (!bitmap_bh)
		goto out_err;
	...
out_err:
	sb->s_dirt = 1;
	put_bh(bitmap_bh);
	...
---
 fs/ext4/mballoc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext4/mballoc.c +1 -1
index 76e5fed..06d1f52 100644
@@ -3069,7 +3069,7 @@ static int ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
 
 out_err:
 	sb->s_dirt = 1;
-	put_bh(bitmap_bh);
+	brelse(bitmap_bh);
 	return err;
 }
 
Signature · 1 line
1.5.4.rc3.24.gb53139-dirty