Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756857Ab3CSOuJ (ORCPT ); Tue, 19 Mar 2013 10:50:09 -0400 Received: from merlin.infradead.org ([205.233.59.134]:39891 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756830Ab3CSOuH (ORCPT ); Tue, 19 Mar 2013 10:50:07 -0400 Message-ID: <1363704594.22553.56.camel@laptop> Subject: Re: [PATCH 3/9] perf util: Get rid of write_or_die() from trace-event-info.c From: Peter Zijlstra To: Steven Rostedt Cc: Namhyung Kim , Arnaldo Carvalho de Melo , Paul Mackerras , Ingo Molnar , Namhyung Kim , LKML , Frederic Weisbecker Date: Tue, 19 Mar 2013 15:49:54 +0100 In-Reply-To: <1363703711.5938.20.camel@gandalf.local.home> References: <1363683224-28804-1-git-send-email-namhyung@kernel.org> <1363683224-28804-4-git-send-email-namhyung@kernel.org> <1363703711.5938.20.camel@gandalf.local.home> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.2-0ubuntu0.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 754 Lines: 24 On Tue, 2013-03-19 at 10:35 -0400, Steven Rostedt wrote: > What about: > int err = 0; > > err += tracing_data_header(); > err += read_header_files(); > [...] > > if (err < 0) { > free(tdata); > tdata = NULL; > } > > Also, is the only clean up needed be freeing tdata? I always use err |= foo() and if (err) but I suppose it doesn't matter the original error codes are lost both ways which doesn't seem to be a problem here. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/