[Ocfs2-tools-devel] [PATCH] o2info: clean up useless branch in o2info_append_task()

piaojun piaojun at huawei.com
Wed Sep 14 02:53:48 PDT 2016


'task' will be NULL if allocating memory fails, so no need to free
'task' in this case.

Signed-off-by: Jun Piao <piaojun at huawei.com>
---
 o2info/o2info.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/o2info/o2info.c b/o2info/o2info.c
index e64564a..aa4103e 100644
--- a/o2info/o2info.c
+++ b/o2info/o2info.c
@@ -348,8 +348,7 @@ static errcode_t o2info_append_task(struct o2info_operation *o2p)
 		task->o2p_task = o2p;
 		list_add_tail(&task->o2p_list, &o2info_op_task_list);
 		o2info_op_task_count++;
-	} else
-		ocfs2_free(&task);
+	}
 
 	return err;
 }
-- 
1.8.4.3




More information about the Ocfs2-tools-devel mailing list