From patchwork Thu Apr 7 11:16:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 8771161 Return-Path: X-Original-To: patchwork-linux-wpan@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2602CC0553 for ; Thu, 7 Apr 2016 11:16:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C90920212 for ; Thu, 7 Apr 2016 11:16:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 862DC2020F for ; Thu, 7 Apr 2016 11:16:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755711AbcDGLQR (ORCPT ); Thu, 7 Apr 2016 07:16:17 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:33128 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755424AbcDGLQQ (ORCPT ); Thu, 7 Apr 2016 07:16:16 -0400 Received: by mail-pf0-f175.google.com with SMTP id 184so54199877pff.0; Thu, 07 Apr 2016 04:16:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=iyD+7Kh1po3ldh2PT0qM/xsR7Er/jdL0wt59T3AknH8=; b=mGJRLZzfwLLeDgf0Qn3DplXEG43lUYergft0DprHjj0FpR7msCc82ruynQ7rzzz7D0 C/9jJnZ491wIDBBxz55OYUV9hQmwUaowqd4oVSO9zDHSIaVqoIyRW6ifn15wnq8Pczxl YsYA9en2lGuWIS9ZkcU8MHm1bwDUf5/DyyXsW1Jxpb37lweqCkSg7wMqgzo5sF842HMX SG+VyCG0nN1MVYlzr3XZwr4b80y4u/zAtz0oHU12wj6cYcvb9SSfHl6IMuFgkBkMrutt j3Ppw0mDPUf0TTkW4hxj/vjlI+PLySL9humG/FjdcpER2NHb2hmruxPa21UqDdwWZBhC FsDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iyD+7Kh1po3ldh2PT0qM/xsR7Er/jdL0wt59T3AknH8=; b=kh3rmBGs59TKUilyILiSJpJFTCDfz9NfJ4hs/oxd/4jZdNY3GbSvF/pIGf2cGmNJJ0 K8RKnkK/MuCY+7983uFwe99X/l1EmEGty2fLMjKk1kJcjrl8nm/blZIrl7WiMs5yPWot yQiv557TzUgakuIrBvVRcIgBRZIaYjaHmWzZNnEgKykpOxkWUV4HMVae+X7TYph/b3FV 2g3etOUjXScm6BRK16MHwu1xW3Af3hr2tSULeKUB0zvMz+73x8XjKMWONvaOKSeldJ8B 5j7ahJejTyLQUP7xXCiYvSnr9ORl0fBycRUs7+2sCD4fJitoOBiLHE3IndQrpwp+zQb8 aBKw== X-Gm-Message-State: AD7BkJLZmbs4p7uBwrq1gy/5I1dwOC2FN7ESuMbM0VoWsP5ghrwuzOO2VZX32IuWoCI+xg== X-Received: by 10.98.18.195 with SMTP id 64mr3996215pfs.131.1460027775438; Thu, 07 Apr 2016 04:16:15 -0700 (PDT) Received: from localhost.localdomain ([103.24.124.194]) by smtp.gmail.com with ESMTPSA id x18sm11495819pfi.42.2016.04.07.04.16.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Apr 2016 04:16:14 -0700 (PDT) From: Sudip Mukherjee To: Michael Hennerich , Alexander Aring Cc: linux-kernel@vger.kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, Sudip Mukherjee Subject: [PATCH] ieee802154/adf7242: fix memory leak of firmware Date: Thu, 7 Apr 2016 16:46:04 +0530 Message-Id: <1460027764-27428-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the firmware upload or the firmware verification fails then we printed the error message and exited but we missed releasing the firmware. Signed-off-by: Sudip Mukherjee Acked-by: Michael Hennerich --- drivers/net/ieee802154/adf7242.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c index 89154c0..91d4531 100644 --- a/drivers/net/ieee802154/adf7242.c +++ b/drivers/net/ieee802154/adf7242.c @@ -1030,6 +1030,7 @@ static int adf7242_hw_init(struct adf7242_local *lp) if (ret) { dev_err(&lp->spi->dev, "upload firmware failed with %d\n", ret); + release_firmware(fw); return ret; } @@ -1037,6 +1038,7 @@ static int adf7242_hw_init(struct adf7242_local *lp) if (ret) { dev_err(&lp->spi->dev, "verify firmware failed with %d\n", ret); + release_firmware(fw); return ret; }