From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752123AbbEDTQu (ORCPT ); Mon, 4 May 2015 15:16:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33848 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752096AbbEDTQk (ORCPT ); Mon, 4 May 2015 15:16:40 -0400 Date: Mon, 4 May 2015 21:16:36 +0200 From: Jiri Olsa To: Taeung Song Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, namhyung@kernel.org Subject: Re: [PATCH 3/4] perf tools: Add a option 'all' to perf-config. Message-ID: <20150504191636.GC11223@krava> References: <1430116466-14427-1-git-send-email-treeze.taeung@gmail.com> <1430116466-14427-3-git-send-email-treeze.taeung@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1430116466-14427-3-git-send-email-treeze.taeung@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 27, 2015 at 03:34:25PM +0900, Taeung Song wrote: SNIP > + > +static int show_all_config(void) > +{ > + int ret = 0; > + struct config_section *section_node; > + struct config_element *element_node; > + char *pwd, *all_config; > + > + pwd = getenv("PWD"); > + all_config = strdup(mkpath("%s/util/PERFCONFIG-DEFAULT", pwd)); > + > + if (!all_config) { > + pr_err("%s: strdup failed\n", __func__); > + return -1; > + } > + > + sections = zalloc(sizeof(*sections)); > + if (!sections) > + return -1; > + INIT_LIST_HEAD(sections); this code pattern is already there, please placeit into function also, where's the section freed? jirka