From patchwork Wed Jan 16 22:01:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cong Ding X-Patchwork-Id: 213081 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4DE362C0092 for ; Thu, 17 Jan 2013 09:08:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757848Ab3APWIB (ORCPT ); Wed, 16 Jan 2013 17:08:01 -0500 Received: from mail-ea0-f177.google.com ([209.85.215.177]:36840 "EHLO mail-ea0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757708Ab3APWIA (ORCPT ); Wed, 16 Jan 2013 17:08:00 -0500 Received: by mail-ea0-f177.google.com with SMTP id n13so716629eaa.36 for ; Wed, 16 Jan 2013 14:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=yyrDBdhYKl6ICT+ZRJ752H36AR/I4+a6wXjPlhFLUdE=; b=NtZHgHvCydYSgmQl8iyV5Hw1Qe4FQ0tZxLHzTHioTfIydzyAMWjQeUQxLI0Tnku3qm OelSu5u630IiJD14UzZHqZGIAatwsrVgg0DA3l3ZqeNipxUGpH27jSisGbgaZV/Yy90O 7+Kw5DyxCeegjAOQnbYl8eix69nUM0ss1ZfSU7AbjGbtmVa3xAxJPTrfpXuGzEsDY8uV a5AKQEgvticZZI7P0P7+kphlpQ1UL8CRzfP4eQi5O9F6zTy50GDHPHJGFaAmVvVMcLn2 EOokTfsHhXWNLO080OuChEEepYWEeKloSRDUFYFYedRkNWFuSQZRXsewqJRb6HY3G/1f mUEw== X-Received: by 10.14.203.8 with SMTP id e8mr6383330eeo.2.1358374079233; Wed, 16 Jan 2013 14:07:59 -0800 (PST) Received: from gmail.com (77.47.90.154.dynamic.cablesurf.de. [77.47.90.154]) by mx.google.com with ESMTPS id e2sm31264091eeo.8.2013.01.16.14.07.57 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 16 Jan 2013 14:07:58 -0800 (PST) Date: Wed, 16 Jan 2013 23:01:54 +0100 From: Cong Ding To: Sam Ravnborg Cc: "David S. Miller" , sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] sparc: kernel/sbus.c: fix memory leakage Message-ID: <20130116220153.GD18593@gmail.com> References: <1358199372-11976-1-git-send-email-dinggnu@gmail.com> <20130116211309.GA13993@merkur.ravnborg.org> <20130116211725.GC18593@gmail.com> <20130116220018.GA14063@merkur.ravnborg.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130116220018.GA14063@merkur.ravnborg.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org the variable iommu and strbuf are not freed if it goes to error. Signed-off-by: Cong Ding --- arch/sparc/kernel/sbus.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/sparc/kernel/sbus.c b/arch/sparc/kernel/sbus.c index 1271b3a..78aa26b 100644 --- a/arch/sparc/kernel/sbus.c +++ b/arch/sparc/kernel/sbus.c @@ -656,6 +656,8 @@ static void __init sbus_iommu_init(struct platform_device *op) return; fatal_memory_error: + kfree(strbuf); + kfree(iommu); prom_printf("sbus_iommu_init: Fatal memory allocation error.\n"); }