From patchwork Mon Mar 23 19:07:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 6074881 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2E4589F2A9 for ; Mon, 23 Mar 2015 19:08:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55B7E20268 for ; Mon, 23 Mar 2015 19:08:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4196E202FF for ; Mon, 23 Mar 2015 19:08:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753300AbbCWTIT (ORCPT ); Mon, 23 Mar 2015 15:08:19 -0400 Received: from mail-ob0-f179.google.com ([209.85.214.179]:36823 "EHLO mail-ob0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752120AbbCWTIS (ORCPT ); Mon, 23 Mar 2015 15:08:18 -0400 Received: by obdfc2 with SMTP id fc2so130719493obd.3 for ; Mon, 23 Mar 2015 12:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=1ujd9ukKA/70B5pDwkZwZOqzYwU4rhpGjmrYysRQZ/I=; b=qjyErdwRNZAeIq6cxQCVxjj7PuEkmFZbNTFuamB+mNTgF4tjYbua1P9g8/ZLUfrSQW JriVbOVx1OV0WmbhknXbShyTLE5uwaxEDJAGXJLeKVkjRMbvPMPsJ76iyQeFvweeJh3X S1x6v1jJY1ek3r9RbVtYez2TifIncMLKizlWOtLqMZW1aJ8LPrTV4JxhS6HoBHNQQ3+f UcHp7/A0Az+tcqtC0Q08VcQukJoYgpV+HpvdP7oqbCSpe+rPTHH3jRX6vItHatoL369+ efsnHTEjs8/DAURI6YSF6mS7BETgIJ9l1G81J/U/RYf7Z53gkwij1+dg7ZQxdzm8eg76 +uZA== X-Received: by 10.60.123.40 with SMTP id lx8mr492117oeb.15.1427137698197; Mon, 23 Mar 2015 12:08:18 -0700 (PDT) Received: from linux.site.site ([75.81.56.199]) by mx.google.com with ESMTPSA id bc12sm859662obd.21.2015.03.23.12.08.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Mar 2015 12:08:17 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Larry Finger , Johannes Berg , Emmanuel Grumbach , Intel Linux Wireless Subject: [PATCH] iwlwifi: Fix memory leak in iwl_req_fw_callback() Date: Mon, 23 Mar 2015 14:07:57 -0500 Message-Id: <1427137677-2879-1-git-send-email-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.1.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_BLACK 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 In this routine, kzalloc allocates a memory block. This allocation is freed in the error paths, but not in the normal exit, thus the allocation is leaked. The kmemleak facility was used to find the leak. Signed-off-by: Larry Finger Cc: Johannes Berg Cc: Emmanuel Grumbach Cc: Intel Linux Wireless --- drivers/net/wireless/iwlwifi/iwl-drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index 66ca000..aefdd9b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c @@ -1319,6 +1319,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) op->name, err); #endif } + kfree(pieces); return; try_again: