Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp839357ybi; Fri, 12 Jul 2019 05:30:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3MlTL2kxi6bsjRRSVyBaDpBbnQEGM5la5HZJetIJAcOlSMluujBVSbN/xWHXZt2mesyKL X-Received: by 2002:a63:2148:: with SMTP id s8mr10363139pgm.336.1562934652119; Fri, 12 Jul 2019 05:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934652; cv=none; d=google.com; s=arc-20160816; b=XB58Q4nsikeiSYnEvejtTBb4GABU/ugEIhsNO8wIF8NT3f7zH1Y4hV4kWadVqetq7i 6O4VLsjkS7ADmGFyMnYayWkEW/bq79j/UfG7tHaNBaZqGPL0bKnhGyzSh/L+qlk8GOhq DXBGqy2Y7kUq0DaOfxJnNgqOdZTDzBDVimHMAYDTxfcyM0HladScVTOa1rNk0n3EfPSW /MOorIC8miciK3Hj74Kzd+RRQLCgn10zoCv9ala4TepkwJs2/jA75narux8Q0zNYHSRb C1UevGRTLeCMw4zJUxitLcdXIeZW3BXAycrdAXX+gM4YDUCaaGBQtAR3p0+JeYYNA24C 0PCg== 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=u1LqssZ3C7nBXxmL7tsHilx6BdydPY6GXNOtCMpsM8E=; b=eDdL8+FfXV0kUVpt7G3tw3LOyRqFjS5T6OW2etSpS4M3EGVnXmHYqXqBSMLe4FQBwX UQekz7Srf0le76DeDyaWBX5KDK+gGsV95xA4hbHKldJNN2KujIx4ynWMu2J815LCq4XG GduRDJABiTH4O9Qq9QVLcIkWPQNYEyJ2Pt3uxwluzKmBa9CPsBn01RmHMpRAfepAU08a 6eRdxQd2vk4KvRVNd4lqAEqFb3q2Vk2NPVlA/TXwOjVWk+gFmGVT+IsvUpqhghCjRM57 vTglnCp0dsoEftIwtVxalvwSkhuhCF5EcJ7xvxwyXqZWeEADpPZtEDTG9GkTJho4cZIB thYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CNlok3PO; 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 b6si2404131pjz.29.2019.07.12.05.30.35; Fri, 12 Jul 2019 05:30: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=CNlok3PO; 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 S1727637AbfGLM2X (ORCPT + 99 others); Fri, 12 Jul 2019 08:28:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:42076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727530AbfGLM2U (ORCPT ); Fri, 12 Jul 2019 08:28:20 -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 7838F2084B; Fri, 12 Jul 2019 12:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934500; bh=IMQot/HOMIyuIRMyLHqWT19plTn8X5tINhLp925YUBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CNlok3POrOt7bskEqP1IO2XRhYnvZqoS5w4GAn45InqrUHFZQswnANVtFh78r0eFm GOeHEaEVppCi3IWJnKLL9gVvg5oshciuhs+cfVTZy5AZbBoeeiXwNg1+W1em+DOBKP mI8ioe7IAqQrcJAUP/U/CGIMAzFaA51hrLbT9QZY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Kandagatla , Pierre-Louis Bossart , Sanyog Kale , Vinod Koul , Sasha Levin Subject: [PATCH 5.1 031/138] soundwire: stream: fix bad unlock balance Date: Fri, 12 Jul 2019 14:18:15 +0200 Message-Id: <20190712121629.888401834@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 [ Upstream commit 9315d904c7e8f38886e2820fa6cb8d0fa723ea21 ] the msg lock is taken for multi-link cases only but released unconditionally, leading to an unlock balance warning for single-link usages This patch fixes this. ===================================== WARNING: bad unlock balance detected! 5.1.0-16506-gc1c383a6f0a2-dirty #1523 Tainted: G W ------------------------------------- aplay/2954 is trying to release lock (&bus->msg_lock) at: do_bank_switch+0x21c/0x480 but there are no more locks to release! Signed-off-by: Srinivas Kandagatla Acked-by: Pierre-Louis Bossart Acked-by: Sanyog Kale [vkoul: edited the change log as suggested by Pierre] Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/soundwire/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index 00618de2ee12..794ced434cf2 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -805,7 +805,8 @@ static int do_bank_switch(struct sdw_stream_runtime *stream) goto error; } - mutex_unlock(&bus->msg_lock); + if (bus->multi_link) + mutex_unlock(&bus->msg_lock); } return ret; -- 2.20.1