From patchwork Tue Mar 3 02:36:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick X-Patchwork-Id: 5918751 Return-Path: X-Original-To: patchwork-ath10k@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 1F4189F380 for ; Tue, 3 Mar 2015 02:37:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26D3120138 for ; Tue, 3 Mar 2015 02:37:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 200682011B for ; Tue, 3 Mar 2015 02:37:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YSchk-0006e8-SD; Tue, 03 Mar 2015 02:37:04 +0000 Received: from mail-ig0-x233.google.com ([2607:f8b0:4001:c05::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YSchL-0006Cz-94 for ath10k@lists.infradead.org; Tue, 03 Mar 2015 02:36:39 +0000 Received: by igjz20 with SMTP id z20so22951168igj.4 for ; Mon, 02 Mar 2015 18:36:16 -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; bh=ZUhw+R1Vv6FstWVscAqc/8vMC4HOCBJ1lIU88uAPNTU=; b=pB9H4j1icB91fOHA5anrEUT0+HN+Z/pXzluyPxMjKasuDidKY2eM43vR+s/pBIkqN0 83zRNzyebh0a9ZjXLK3nXKGIyqf6oHLC+JBnfzmz/KS0GYEuFApLVPaoG+9Z/Cyum/zC RrJUn1IVfwJXM2fHRTDrmnHlprORTLOhd+92StkRXDemc6mBcA5znnK3DP54Jlhdb2Yx cR58WZIF8wDuig6TTC52mHU0xbHZFudH0AEQf2MeFXXCxB0B2RQi9jvebTmqbB/Do6SN wYWhEBCob71T9Fb6e7lcRmR1xoW1fnVn4Cq16qAUi5r91nEyPqElvSIxeiA2K5pAuYAq 8sjA== X-Received: by 10.50.137.99 with SMTP id qh3mr26811712igb.7.1425350176769; Mon, 02 Mar 2015 18:36:16 -0800 (PST) Received: from nick-System-Product-Name.phub.net.cable.rogers.com (CPE0026f3330aca-CM0026f3330ac6.cpe.net.cable.rogers.com. [99.231.92.7]) by mx.google.com with ESMTPSA id qd2sm8019603igc.22.2015.03.02.18.36.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Mar 2015 18:36:15 -0800 (PST) From: Nicholas Krause To: kvalo@qca.qualcomm.com Subject: [PATCH] ath:Release resources for structure pointer, ar if error pointing device in the function, ath10k_core_register_work Date: Mon, 2 Mar 2015 21:36:11 -0500 Message-Id: <1425350171-26333-1-git-send-email-xerofoify@gmail.com> X-Mailer: git-send-email 2.1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150302_183639_387231_5D5A02D4 X-CRM114-Status: UNSURE ( 7.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, ath10k@lists.infradead.org X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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 Releases resources and deregisters the stucture pointer ar passed by the caller to the function, ath10k_core_register_work if unable to probe the structure pointer successfully with a call to ath10k_core_probe_fw. Further more if this happerns we must first jump to the label err for the goto statement required to jump to handle this particular error in the function, ath10k_core_register_work. After we are in the correct error section we must free the resources for the structure pointer,ar with a call to the function, ath10k_core_unregister to free resources allocated for the structure pointer,ar. Signed-off-by: Nicholas Krause --- drivers/net/wireless/ath/ath10k/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 310e12b..8b2ca25 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -1307,9 +1307,7 @@ err_unregister_mac: err_release_fw: ath10k_core_free_firmware_files(ar); err: - /* TODO: It's probably a good idea to release device from the driver - * but calling device_release_driver() here will cause a deadlock. - */ + ath10k_core_unregister(ar); return; }