Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp461956yba; Wed, 15 May 2019 04:32:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgpM1lLnGqTzPcMc5J2psiJdc5TkqVZHo/MtCmDZ3pIphtgJxuTCcXjciUJQMo9JwIOkdS X-Received: by 2002:a17:902:7002:: with SMTP id y2mr44069260plk.75.1557919928794; Wed, 15 May 2019 04:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557919928; cv=none; d=google.com; s=arc-20160816; b=pdsRqXC085Bysv4OxXsU1tSD2qloanak6kJVfhwqDD84foYNQRHl8JArSfXky+En7w vjoP6wkkGWn4JGn2ZZKj/IWc4AYbDvqBXeXz2DdXLDHPlrJ9/g0a5Mujr4BzLwTVDxS7 9TtOHoi2qPNndvBmheDgDB9jqsC8xN9yLhnH0abFH7l6k3nPKNyvFpEQ8f8WDd4h0RKY Dc3QWd+1eBXkKGT7Br22JldAyI8/DYJhvFa5ymnmOKk9BiI+gGvtQau1x8w2zrlVz/Fs QHrIgCOe5vNUisrL0SAO8uF3sWuoZrXrGsTRZMCE6hBZkJB3DCCUS1pfUTYkdupMwSzw JQQg== 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=AY9iymvAkzSFloHxV1u3DLZ/LxhLSt8d/SMSfJmSQDc=; b=kBtBedNU8RBUFhhCqLqs8d3BOCYwWK/sTaqjxo3P9YY3/VMkKYCQgokhBPVoLhomYg 7vuM16Gemp4wRVxDydJKLo6WxG9qgLlYZCy+3UbuUkVcvaZhotdYPJlB06Nl9UeByQHY qhRe24udAx9qYle7ju5tLDWFlB6L6nOvpYNhHOsBl0EgX//KNQPwOZCXwTWtB9+cayEk NbvXOAfVuk06E/JLTubVyDAqfwV1bhZ485Bzv2WPyj6eslb9IwHhVJiI8ds57Wlo0eEZ HHl6Px5SYpqqNakI1qFCx3ik826r2gzZn5LCLJzigURCETPveosbtyRycVX3pine+YkW j4aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZCzR+OUX; 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 g191si1652534pgc.197.2019.05.15.04.31.53; Wed, 15 May 2019 04: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=ZCzR+OUX; 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 S1732678AbfEOLaL (ORCPT + 99 others); Wed, 15 May 2019 07:30:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:41576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732675AbfEOLaI (ORCPT ); Wed, 15 May 2019 07:30:08 -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 157A0206BF; Wed, 15 May 2019 11:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919807; bh=5lQQSp2MY0e8p5PILottSeNZMveQFwsHmlVtymy3HyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZCzR+OUXXxn8boGouc1bCBM0hiR8Zm2SieIfQlJv9dyoOmc3l6Lwz/Kw3Wnc2mkuy s4xPHSf+yCszb4tj9+jxh7yzwmn0YT2h5NbPIafOtMXgeVMu3YOAjJeioGB+EhZTe3 T+MgLT1Jl2vrQ9m0Ze/goOhvYVkdVKsWS5+bRNw0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wei Yongjun , Jia-Ju Bai , Kalle Valo Subject: [PATCH 5.0 101/137] cw1200: fix missing unlock on error in cw1200_hw_scan() Date: Wed, 15 May 2019 12:56:22 +0200 Message-Id: <20190515090700.860655131@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@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: Wei Yongjun commit 51c8d24101c79ffce3e79137e2cee5dfeb956dd7 upstream. Add the missing unlock before return from function cw1200_hw_scan() in the error handling case. Fixes: 4f68ef64cd7f ("cw1200: Fix concurrency use-after-free bugs in cw1200_hw_scan()") Signed-off-by: Wei Yongjun Acked-by: Jia-Ju Bai Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/st/cw1200/scan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/net/wireless/st/cw1200/scan.c +++ b/drivers/net/wireless/st/cw1200/scan.c @@ -84,8 +84,11 @@ int cw1200_hw_scan(struct ieee80211_hw * frame.skb = ieee80211_probereq_get(hw, priv->vif->addr, NULL, 0, req->ie_len); - if (!frame.skb) + if (!frame.skb) { + mutex_unlock(&priv->conf_mutex); + up(&priv->scan.lock); return -ENOMEM; + } if (req->ie_len) skb_put_data(frame.skb, req->ie, req->ie_len);