nandfs_meta_bread() calls bread() which can set bp to NULL in some
error cases. Calling brelse() with a NULL pointer is not allowed, so only call brelse() when the bp is non-NULL. Reported by: Maxime Villard (reported as uninitialized variable)
This commit is contained in:
parent
9baadf23b3
commit
58c9460670
@ -317,7 +317,8 @@ bmap_truncate_indirect(struct nandfs_node *node, int level, nandfs_lbn_t *left,
|
||||
|
||||
error = nandfs_bread_meta(node, lbn, NOCRED, 0, &bp);
|
||||
if (error) {
|
||||
brelse(bp);
|
||||
if (bp != NULL)
|
||||
brelse(bp);
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user