summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
779bf3f)
Signed-off-by: David Sterba <dsterba@suse.com>
sctx->clone_roots_cnt = arg->clone_sources_count;
sctx->send_max_size = BTRFS_SEND_BUF_SIZE;
sctx->clone_roots_cnt = arg->clone_sources_count;
sctx->send_max_size = BTRFS_SEND_BUF_SIZE;
- sctx->send_buf = vmalloc(sctx->send_max_size);
+ sctx->send_buf = kmalloc(sctx->send_max_size, GFP_KERNEL | __GFP_NOWARN);
- ret = -ENOMEM;
- goto out;
+ sctx->send_buf = vmalloc(sctx->send_max_size);
+ if (!sctx->send_buf) {
+ ret = -ENOMEM;
+ goto out;
+ }
}
sctx->read_buf = vmalloc(BTRFS_SEND_READ_SIZE);
}
sctx->read_buf = vmalloc(BTRFS_SEND_READ_SIZE);
fput(sctx->send_filp);
vfree(sctx->clone_roots);
fput(sctx->send_filp);
vfree(sctx->clone_roots);
+ kvfree(sctx->send_buf);
vfree(sctx->read_buf);
name_cache_free(sctx);
vfree(sctx->read_buf);
name_cache_free(sctx);