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

Joseph Qi joseph.qi at huawei.com
Sat Sep 17 17:20:54 PDT 2016


Thanks, Jun.
Reviewed-by: Joseph Qi <joseph.qi at huawei.com>

On 2016/9/14 17:53, piaojun wrote:
> '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;
>  }
> 





More information about the Ocfs2-tools-devel mailing list