From 759da7c3e72f0df5c77355262a32ccba8ab66df8 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Wed, 1 Aug 2012 12:07:43 +0200 Subject: [PATCH] --- yaml --- r: 332511 b: refs/heads/master c: 5dc67d0ba915cda01ed3a980502945edf2c46b70 h: refs/heads/master i: 332509: 0a8db622ebac95d32a03a3d7e2ef45c3ff0a6ea7 332507: 6c928c40c4a581a13dde67993dbe1ea33e2f17fd 332503: d059518262c791a0cb26771e01d8d5f032226782 332495: 2ef5d0cdb6fb3156729b0df59d7bac862a4850ef 332479: 6db4cd8eff2e3e079812c7d873aa56f328df9c4b v: v3 --- [refs] | 2 +- trunk/fs/btrfs/send.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 51a7b917c2f8..97781702231c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3e126f32f88095ad1bd01b3c451e52aa9094f45c +refs/heads/master: 5dc67d0ba915cda01ed3a980502945edf2c46b70 diff --git a/trunk/fs/btrfs/send.c b/trunk/fs/btrfs/send.c index b0f9df30f24d..cfbe987f854b 100644 --- a/trunk/fs/btrfs/send.c +++ b/trunk/fs/btrfs/send.c @@ -1759,6 +1759,7 @@ static int did_overwrite_first_ref(struct send_ctx *sctx, u64 ino, u64 gen) * Insert a name cache entry. On 32bit kernels the radix tree index is 32bit, * so we need to do some special handling in case we have clashes. This function * takes care of this with the help of name_cache_entry::radix_list. + * In case of error, nce is kfreed. */ static int name_cache_insert(struct send_ctx *sctx, struct name_cache_entry *nce) @@ -1775,8 +1776,11 @@ static int name_cache_insert(struct send_ctx *sctx, INIT_LIST_HEAD(nce_head); ret = radix_tree_insert(&sctx->name_cache, nce->ino, nce_head); - if (ret < 0) + if (ret < 0) { + kfree(nce_head); + kfree(nce); return ret; + } } list_add_tail(&nce->radix_list, nce_head); list_add_tail(&nce->list, &sctx->name_cache_list);