Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752955Ab0BVN2G (ORCPT ); Mon, 22 Feb 2010 08:28:06 -0500 Received: from ey-out-2122.google.com ([74.125.78.26]:31639 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752102Ab0BVN2B (ORCPT ); Mon, 22 Feb 2010 08:28:01 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; b=PpAp8cGAJpBEbDsMiHCIz5n8Om4+0povl32dHXn8nuh7MXE2FqrE3uNLvJjME59RmX HFxdSBgUL0UHEhHNgPo2GzF6kL0/m3G4+ERWfZNFNyoSPIYmHi91B5tOG6MsDsB+qg+t GL2ReDSEER5T7pLXXNxiSEgUUjOq4H0CRtb7M= Date: Mon, 22 Feb 2010 16:27:43 +0300 From: Dan Carpenter To: Thomas Gleixner Cc: LKML , rt-users , Ingo Molnar , Steven Rostedt , Peter Zijlstra , Carsten Emde , Clark Williams , Frank Rowand , Robin Gareus , Gregory Haskins , Philippe Reynes , Fernando Lopez-Lezcano , Will Schmidt , Darren Hart , Jan Blunck , Sven-Thorsten Dietrich , Jon Masters , Mark Knecht , John Kacur , Nick Piggin Subject: [patch] latency_hist: fix small memory leak Message-ID: <20100222132743.GB5416@bicker> Mail-Followup-To: Dan Carpenter , Thomas Gleixner , LKML , rt-users , Ingo Molnar , Steven Rostedt , Peter Zijlstra , Carsten Emde , Clark Williams , Frank Rowand , Robin Gareus , Gregory Haskins , Philippe Reynes , Fernando Lopez-Lezcano , Will Schmidt , Darren Hart , Jan Blunck , Sven-Thorsten Dietrich , Jon Masters , Mark Knecht , John Kacur , Nick Piggin References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 818 Lines: 25 index_ptr needs to be freed on the error path. Signed-off-by: Dan Carpenter diff --git a/kernel/trace/latency_hist.c b/kernel/trace/latency_hist.c index b3b5ea2..8edc70c 100644 --- a/kernel/trace/latency_hist.c +++ b/kernel/trace/latency_hist.c @@ -204,8 +204,10 @@ static void *l_start(struct seq_file *m, loff_t *pos) , my_hist->beyond_hist_bound_samples , MAX_ENTRY_NUM, "samples"); } - if (index >= MAX_ENTRY_NUM) + if (index >= MAX_ENTRY_NUM) { + kfree(index_ptr); return NULL; + } *index_ptr = index; return index_ptr; -- 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/