Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp845015ybi; Fri, 12 Jul 2019 05:36:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWTJh/ZVYHthFNiKIbANju7POUJpHykNuPFWV7qTUR3LcQa1EtQyHxnc+MMHQDtoj3rSpk X-Received: by 2002:a17:902:6a2:: with SMTP id 31mr10694023plh.296.1562934964451; Fri, 12 Jul 2019 05:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934964; cv=none; d=google.com; s=arc-20160816; b=fx14eBLOWpgXEzIFrCLUJeMbYygkI3ioF6mibQhLgx56pmDWcag7zuQbW25/BnF3Cc bkww5WrmvOMCC7eDgZxfk7z7znJJhyeggwRA3Yc/Gzemu/rlrq/eKKvdjZB2cbdCmrmM urWpeZQqe+tlKgPBR0+138/qh5DmLG/+xH5GrrxR+wbOjFlUowBtoMZwVsyoGEpKT6nQ wbOEP0s1MFmEPkw+IUuDAXy5yhFlb/n/mU4iLV49FWTofxuBGfRLk7ZJEaE6yw2KiDAt iiI2ppJdCk7egV44NpGVLk6fr9aEUulIIf3OL+lpmZUAf6/hOdToGB6/YKldbDenIW4N 37Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5cFtnBESDp9QksdryjJ6J/A/UlOa80CsJeuQ9U7HuJU=; b=OMjry/Vvy6rpFLFOyTtt+y+BzgUKo5Ty2/woBxPcRMcWhMbrGV6/8t/j6i6Yv4tLSq /60xos5hgB3QcLBe4MOgBtRb59S7EsWBNlq4wboUrZerP2g4sD87OM2+mX2p2oqro+kp 9Q1fvmqJkD7GPOd9QQ4T+cuL+K4XGiimdCkICVwvHANJTXL/apW0dcl28kc7Po1PI1z0 Dm9VhqAJCkIbiN4d0i0uVxnUsorSESrbImIY9HyPasQjHCYU49fy7/cTMQRHldrlg5Zj wi6z61GhkrMRtjrU/mIr46buAIa4quOCstgooggiCwwkL649Yq9TwfgmQD+C3nL8hO5e obXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A3ct9Bjs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t125si8098164pgt.344.2019.07.12.05.35.48; Fri, 12 Jul 2019 05:36:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A3ct9Bjs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729163AbfGLMdh (ORCPT + 99 others); Fri, 12 Jul 2019 08:33:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:52650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729614AbfGLMd2 (ORCPT ); Fri, 12 Jul 2019 08:33:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E09EE208E4; Fri, 12 Jul 2019 12:33:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934807; bh=BVaPzCcCRxog7PRN36yt9WFA3YWErUvntYn/2BoLlTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A3ct9BjszYQUmjrUSl8Z6yqH6Fpa5YEXRvWIqDQF3GH2scNkvA3gfXTfhoxdBfFOe 9LJE5BOUU7Kt0dx5iUnUa76qntvLvngceu7nL39w6zzlsvJblyiBsrT4UDnULilQ5V iFUsIeNlpwQLD1j8rjGu+neOQhodgKYaag8/A4ps= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ajay Singh Subject: [PATCH 5.2 36/61] staging: wilc1000: fix error path cleanup in wilc_wlan_initialize() Date: Fri, 12 Jul 2019 14:19:49 +0200 Message-Id: <20190712121622.540802831@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121620.632595223@linuxfoundation.org> References: <20190712121620.632595223@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ajay Singh commit 6419f818ababebc1116fb2d0e220bd4fe835d0e3 upstream. For the error path in wilc_wlan_initialize(), the resources are not cleanup in the correct order. Reverted the previous changes and use the correct order to free during error condition. Fixes: b46d68825c2d ("staging: wilc1000: remove COMPLEMENT_BOOT") Cc: Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wilc1000/wilc_netdev.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/staging/wilc1000/wilc_netdev.c +++ b/drivers/staging/wilc1000/wilc_netdev.c @@ -530,17 +530,17 @@ static int wilc_wlan_initialize(struct n goto fail_locks; } - if (wl->gpio_irq && init_irq(dev)) { - ret = -EIO; - goto fail_locks; - } - ret = wlan_initialize_threads(dev); if (ret < 0) { ret = -EIO; goto fail_wilc_wlan; } + if (wl->gpio_irq && init_irq(dev)) { + ret = -EIO; + goto fail_threads; + } + if (!wl->dev_irq_num && wl->hif_func->enable_interrupt && wl->hif_func->enable_interrupt(wl)) { @@ -596,7 +596,7 @@ fail_irq_enable: fail_irq_init: if (wl->dev_irq_num) deinit_irq(dev); - +fail_threads: wlan_deinitialize_threads(dev); fail_wilc_wlan: wilc_wlan_cleanup(dev);