Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2230910ybi; Thu, 20 Jun 2019 11:15:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeBJkoaBo+i0yP+cDYmfAsOeG8pmpN2DWqJJXRXKYmR5EKUMoycqucV5Q4ZIZgFiesVmNj X-Received: by 2002:a17:90a:30e4:: with SMTP id h91mr932847pjb.37.1561054552730; Thu, 20 Jun 2019 11:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054552; cv=none; d=google.com; s=arc-20160816; b=O3v2MWpMyNyI7QhbEV9eFokC0tPQYZTuZX6AFvz8zm3hGgYN1+faTCeBHlHYe+KSMt nIre1Lg+tl/C51J8I0q+NlydOyrB0iXBWtWwDizZHvdWR5cb+fjj9N+K/ggDZbGj4IAb N8DIV3W5sabK/HyHSDvgZ2wxBDAmgQ/+uIAsDOIqFrUMH7hZREmoXv2Wg0yjROGG6Y4q g1I0frOUvs1YIbr6ltanDIJ2M8a80cUnKK3RqrUUjRO5MDhscECjLSIlWsLz+6arX40V BcatjuNJEQMKN6Ktq/ythTsi1SfNtwUmvL8rwTzF4ARMzjbAbh/KrTex1kap9ncCScZd uLVw== 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=MxhUhlI1g1qP1zwvcbnMI/ZxkNiQUDmK/c6v8x71uPs=; b=HWLt+UQEDem50p9ENuBO9JQvls2c2QEO8jhzY9bffi10dLomm81+wMhS47kXH+YCiO owCrq8iVhn8Qb2yO0oy6O18gl9hX44xCUiTCnwpy0HU3u7Dx/1RmXcq9GUryGo9a9z/1 RSlk+V9/C6WCH3JbF3rjN+c6sYHBJLRuRmv2Wx/6OBqgXmwqQWZqZ3Qg9R7ElGdQB0eU d+rOQAO9Hjf2N75odSKLmLO738Lhzacli5Do4eMuszYBoskgN4knvh7g8MDeo8ClS8qz Spp+vGy5KwJPQjoib05WcwN3sbDXijZpFYQ6khfgpSNtA0qyQe0bh4iVkMfv0ATbpDg/ t2NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mipC7RZ7; 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 d2si449095pjs.10.2019.06.20.11.15.37; Thu, 20 Jun 2019 11:15:52 -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=mipC7RZ7; 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 S1729436AbfFTSOU (ORCPT + 99 others); Thu, 20 Jun 2019 14:14:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:42562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729426AbfFTSOT (ORCPT ); Thu, 20 Jun 2019 14:14:19 -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 91857205F4; Thu, 20 Jun 2019 18:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054458; bh=qaolnFThAXRJh7xb80Fx8IN+cYUOpdIQLpeqRO5twEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mipC7RZ7lqNgX6Zm6YC7Xh9fG0Fh3Xa7w5h2it3OClf2G1I4eegqNXS2cqLU8fyQM gBxK9CD+fsZs4UAfuBQCgEMqMIVrzvaJKRKun0zG63qv2O6VkOd5cejvPZbPq0r2+O jnTtN/LoxD3z20aLWlmqsnScjOFpMSasuHxLvw/I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Sasha Levin Subject: [PATCH 5.1 35/98] staging: wilc1000: Fix some double unlock bugs in wilc_wlan_cleanup() Date: Thu, 20 Jun 2019 19:57:02 +0200 Message-Id: <20190620174350.685315646@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@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 [ Upstream commit fea69916360468e364a4988db25a5afa835f3406 ] If ->hif_read_reg() or ->hif_write_reg() fail then the code unlocks and keeps executing. It should just return. Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver") Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/wilc1000/wilc_wlan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index c2389695fe20..70b1ab21f8a3 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1076,13 +1076,17 @@ void wilc_wlan_cleanup(struct net_device *dev) acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, ®); - if (!ret) + if (!ret) { release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + return; + } ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, (reg | ABORT_INT)); - if (!ret) + if (!ret) { release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); + return; + } release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); wilc->hif_func->hif_deinit(NULL); -- 2.20.1