From patchwork Fri Aug 26 12:47:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 111774 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 91AA2B6F90 for ; Fri, 26 Aug 2011 22:48:40 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2807828177; Fri, 26 Aug 2011 14:48:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4eR7Fk8NvGYu; Fri, 26 Aug 2011 14:48:18 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8152D28178; Fri, 26 Aug 2011 14:47:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D61AA280EF for ; Fri, 26 Aug 2011 14:47:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J2vJ-dNn9UaI for ; Fri, 26 Aug 2011 14:47:51 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bw0-f44.google.com (mail-bw0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id 7F10228145 for ; Fri, 26 Aug 2011 14:47:42 +0200 (CEST) Received: by mail-bw0-f44.google.com with SMTP id r4so2287832bka.3 for ; Fri, 26 Aug 2011 05:47:42 -0700 (PDT) Received: by 10.204.140.88 with SMTP id h24mr565630bku.167.1314362862239; Fri, 26 Aug 2011 05:47:42 -0700 (PDT) Received: from localhost ([178.23.216.97]) by mx.google.com with ESMTPS id q15sm465888bke.4.2011.08.26.05.47.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 26 Aug 2011 05:47:41 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Fri, 26 Aug 2011 14:47:22 +0200 Message-Id: <1314362843-18214-7-git-send-email-monstr@monstr.eu> X-Mailer: git-send-email 1.5.5.1 In-Reply-To: <1314362843-18214-6-git-send-email-monstr@monstr.eu> References: <1314362843-18214-1-git-send-email-monstr@monstr.eu> <1314362843-18214-2-git-send-email-monstr@monstr.eu> <1314362843-18214-3-git-send-email-monstr@monstr.eu> <1314362843-18214-4-git-send-email-monstr@monstr.eu> <1314362843-18214-5-git-send-email-monstr@monstr.eu> <1314362843-18214-6-git-send-email-monstr@monstr.eu> Subject: [U-Boot] [PATCH 7/8] net: emaclite: Free allocated space for device X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Free allocated space for device when allocating failed for private data. Signed-off-by: Michal Simek --- drivers/net/xilinx_emaclite.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index ac6c783..e0b6ce5 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -356,8 +356,10 @@ int xilinx_emaclite_initialize (bd_t *bis, int base_addr) return -1; emaclite = calloc(1, sizeof(struct xemaclite)); - if (emaclite == NULL) + if (emaclite == NULL) { + free(dev); return -1; + } dev->priv = emaclite;