From patchwork Thu Dec 18 08:09:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 5511441 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6D70DBEEBA for ; Thu, 18 Dec 2014 08:11:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF27A209DE for ; Thu, 18 Dec 2014 08:11:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE0D3209FD for ; Thu, 18 Dec 2014 08:11:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752227AbaLRIL0 (ORCPT ); Thu, 18 Dec 2014 03:11:26 -0500 Received: from mail-wg0-f44.google.com ([74.125.82.44]:57098 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751965AbaLRILY (ORCPT ); Thu, 18 Dec 2014 03:11:24 -0500 Received: by mail-wg0-f44.google.com with SMTP id b13so895940wgh.3 for ; Thu, 18 Dec 2014 00:11:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MlWATsYNPG9GQDQVIg4eN4XqwOe8464Anxepz4g9CU8=; b=c6M4gtyqJk0Dc/ZCZ3j9GbytLHRUU7j9k+Y2cXYD97ywDt7FUVc/snAbSxrzlbHlEy VGEcsVWi1VUPIY1tJA6Y5yRP8w/Z3WjWXn2eis6gIM6duaEJvvO3mJKDpw7WxbUkXomt kU9jWD1oVbCzcw0Yj7EQDGymZ2ZqbnYUVj0b/11n0dmsrM5eZItlI7sXQ/MctS40PPsg R9M9Qo4In2kjVG9vLsesAR5sEOryJzp3L80PvguS9J9/q22zk0UMKQS9TY/j8jqbMS5C uWAzSFukQtRNaUsoWXcah7NjceYbp1zANpzVZGolvh0g51Qj0oJihW6ijfYNeNa31xeC 0RiA== X-Received: by 10.195.11.6 with SMTP id ee6mr1572576wjd.95.1418890282905; Thu, 18 Dec 2014 00:11:22 -0800 (PST) Received: from localhost.localdomain (93-172-128-38.bb.netvision.net.il. [93.172.128.38]) by mx.google.com with ESMTPSA id j2sm7968614wjs.28.2014.12.18.00.11.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Dec 2014 00:11:22 -0800 (PST) From: Emmanuel Grumbach To: linux-wireless@vger.kernel.org Cc: Emmanuel Grumbach Subject: [PATCH 3/5] iwlwifi: don't double free a pointer if no FW was found Date: Thu, 18 Dec 2014 10:09:59 +0200 Message-Id: <1418890201-15177-3-git-send-email-egrumbach@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <0BA3FCBA62E2DC44AF3030971E174FB31B5CD8C0@hasmsx107.ger.corp.intel.com> References: <0BA3FCBA62E2DC44AF3030971E174FB31B5CD8C0@hasmsx107.ger.corp.intel.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 From: Emmanuel Grumbach In the very unlikely case in which no firmware could be, found. the same pointer was freed twice. Fix that. Fixes: 490fefebb6db ("iwlwifi: define the .ucode file format for debug") Reviewed-by: Johannes Berg Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index 38de151..850b85a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c @@ -1323,10 +1323,10 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) try_again: /* try next, if any */ - kfree(pieces); release_firmware(ucode_raw); if (iwl_request_firmware(drv, false)) goto out_unbind; + kfree(pieces); return; out_free_fw: