Skip to content

Commit 2b91b28

Browse files
committed
iomap: iomap_bmap should check iomap_apply return value
Coverity caught this fairly minor bug, but we should check the return value of iomap_apply regardless. Coverity-id: 1437065 Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent add66fc commit 2b91b28

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/iomap/fiemap.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,16 @@ iomap_bmap(struct address_space *mapping, sector_t bno,
133133
struct inode *inode = mapping->host;
134134
loff_t pos = bno << inode->i_blkbits;
135135
unsigned blocksize = i_blocksize(inode);
136+
int ret;
136137

137138
if (filemap_write_and_wait(mapping))
138139
return 0;
139140

140141
bno = 0;
141-
iomap_apply(inode, pos, blocksize, 0, ops, &bno, iomap_bmap_actor);
142+
ret = iomap_apply(inode, pos, blocksize, 0, ops, &bno,
143+
iomap_bmap_actor);
144+
if (ret)
145+
return 0;
142146
return bno;
143147
}
144148
EXPORT_SYMBOL_GPL(iomap_bmap);

0 commit comments

Comments
 (0)