diff --git a/fs/bfs/file.c b/fs/bfs/file.c index fa66a09e496a..5fb6428d692d 100644 --- a/fs/bfs/file.c +++ b/fs/bfs/file.c @@ -40,6 +40,11 @@ static int bfs_move_block(unsigned long from, unsigned long to, if (!bh) return -EIO; new = sb_getblk(sb, to); + if (!new || !buffer_uptodate(new)) { + bforget(bh); + return -ENOMEM; + } + memcpy(new->b_data, bh->b_data, bh->b_size); mark_buffer_dirty(new); bforget(bh);