Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp840733ybi; Fri, 12 Jul 2019 05:32:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuPk/GM5U0LsdGuqjedljc4+nnfwS1Qm5Fr7WGXRNCxIeXAaz76EtmHZbUXaFrJBdiR7HR X-Received: by 2002:a63:4c46:: with SMTP id m6mr10861205pgl.59.1562934728738; Fri, 12 Jul 2019 05:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934728; cv=none; d=google.com; s=arc-20160816; b=O38DqzTWz0CboYOr/0NuaKU+sZWKUGrlVY2wdcfd5Lm3xvO/yaFy2c6g/BL6QtKbs1 Ok/6y5G8Zg02scYS+VDei5oYlfSA1Bm00tUMCy0cQ1PTOZINTnJXr/8Xw+3Z4867OjpU oOv8rfTJVJH3REPkDnQ0JK5skvgHMuoj/FPdh3YeLVYbiutfOTCbj96hSgGlizLtoMsZ sMRyqYDLjIWBQRoJCbljI2nKQ5No8zIyTYCwI0NOZ6ee1TLXq0q23ZPzX06P97AVdWv8 pH9YtOXgpuy/atK5i4nc7ZyrS50DyKlctVP2+W29mzw1Noud3ue+G+ihuH8zaiJSyZpv N6aw== 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=B2z91x40doVH4oa19cDmlzs+h5PVopCr7xLChl/R7DdDHKSCJtrv2sXVZbVvfw1aIT 3+HThpHWGGcIdz7AavzMGPgGZ9OisatZnVq/OQ9evx1OdO7bn7V5dzfoXWzN2gevrmff qMDPrTIB6HZo8SrlEz+99eOSrHWEwgL69qYrqfzxu5MtoTzqinmxMW+ehxyFQXH47Qfq pkLmuPDeHKwYAn6LY//uhMaQ49IUIzMQ/557Ii/zwSDLsSAlYFehiRoV+jaofn/JVN4E vwH3JrsP179EIEHI7W4tuQFvOaRB/Insyc6tbLDaYGBQrB9iHyqJASkhjMG5UP+S31Cr Lb9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=grK3Np1H; 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 z185si8281766pfb.109.2019.07.12.05.31.53; Fri, 12 Jul 2019 05:32:08 -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=grK3Np1H; 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 S1729273AbfGLMbA (ORCPT + 99 others); Fri, 12 Jul 2019 08:31:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:47220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729254AbfGLMa6 (ORCPT ); Fri, 12 Jul 2019 08:30:58 -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 7AAEE216B7; Fri, 12 Jul 2019 12:30:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934658; bh=BVaPzCcCRxog7PRN36yt9WFA3YWErUvntYn/2BoLlTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=grK3Np1HVn2KVm2SxF4T9YxiAgabd3ZZZ0LhfttirmVOiiGx+rIl7O5oaPQ6GNQMs MncJ6Z//sqiBWWFsskmEV+wq9GujGZIPCsva9NDTVehAj73HihaOt7LiJCOY9sTKBE MfOArHVaQujNXpaokN8sxM86sZFmsUGOwqWssJJc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ajay Singh Subject: [PATCH 5.1 120/138] staging: wilc1000: fix error path cleanup in wilc_wlan_initialize() Date: Fri, 12 Jul 2019 14:19:44 +0200 Message-Id: <20190712121633.348340719@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@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);