From patchwork Wed May 22 16:25:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 164850 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1065437ili; Wed, 22 May 2019 09:25:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZ3Zqu1H9hWBVHRfYzytiM6TF5QIBWVZXrQEFtVcQ/7yZrZe2n2+BNxz0cdfwe4B+78skA X-Received: by 2002:aa7:8acb:: with SMTP id b11mr96317311pfd.115.1558542340342; Wed, 22 May 2019 09:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558542340; cv=none; d=google.com; s=arc-20160816; b=mDiAWP178THqjraZ8wl1njUj9a1VzQyEqs7yw/B8gmlIcCaaCw7+ihIkdVynG2CqEz QN6R0Z0CyOudiB3Tb6pO6gShFzWff8qlwNnTz5L+jP69np9IQuIK8wacZQp67HeFlQR4 kZrZDIRwkGq3fZE34Yb2aBtsXDP+bt38jqtJm6XmtN+zgFEJe2huHA/D8zYeH519LDgC Q9So/4YisJ3vly4B6upAeagIgBArmHhGsxGBqsDb1umfM6VbMM0Kpx2ib5fp0pD0jQej PlPcySmAISsZfe6NQkQCx7Q70mwo3LpYzS5jRqLLbzNHoDg4r1u8n7Gi/+gCNyJ4IP96 SpLw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=AztR0YxQPjo+dl6FLzdHONEyjeweZt0zVC2E221XWlQ=; b=c5Q7XwfElgjZwBn6VcBTwMotjjEdoBmlmJy/SDviVko1Zchj/RiktmnSFm3HG2pmhE 61ZfHrfGSeVcCtDPqEoKYJC2qdYX0MgsPNE5yrR1p1PiRuqe1BVsI6gFVVx2wv1SGzph oI9w8LQ3f0ZDLjJPE3zcNYNZ1e20k0EWGDn4YVpcnMHpW2XToSa83gZPJhO3CuePZOIi fZqQ1lfMXAeH4NxMBppWxt5Ji7qIGRLhuPo2TF05Gu2s3vAfuiyDPk7FxK8K/GVXN8WN bRcLZl11cwoFyCWYMC1YKc6pvOnxXv8OZ8XKCGWdgc6GvGC4ae9DYB0+wdsvBHNx8Dk2 caJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FQFZQ5pL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si24543713pls.372.2019.05.22.09.25.38; Wed, 22 May 2019 09:25:40 -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=@linaro.org header.s=google header.b=FQFZQ5pL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730109AbfEVQZi (ORCPT + 30 others); Wed, 22 May 2019 12:25:38 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39749 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729475AbfEVQZh (ORCPT ); Wed, 22 May 2019 12:25:37 -0400 Received: by mail-wm1-f65.google.com with SMTP id n25so2858578wmk.4 for ; Wed, 22 May 2019 09:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AztR0YxQPjo+dl6FLzdHONEyjeweZt0zVC2E221XWlQ=; b=FQFZQ5pLhc3+G+tTnarBWj9uCgHvf6MQVBOxmiQB84MjmbRYL3d9lr0xad3tVwk8Us KBrk17D7HVu1WMERpxk6odDZFQxiXDopaksQeKlUNuYq7ZyHbsKfDGBajoJYU8L1O9Lp iCjUt7y3UsBPgcPyZ9PlKEefGwcj5aKUxuSOclGe3gowAl3nU5/Ney9Q3IodZ7ZbGWTS 24uMV/lfJ01p2zjjMsk54w8H7v7gA6bNoMNIR//+Z/SHeppmnhUqCuZsW1ZS0QZEpBSw CEwgWTUze6dsp6PxquA3kWgBIxrU8SuBShC89UFH77qqyEnAoFfQTaSw9H7snGzQACyQ gV2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AztR0YxQPjo+dl6FLzdHONEyjeweZt0zVC2E221XWlQ=; b=G/JTZhsdtqKYrJrp6DIdk9YgQBfQhNFjseFUUOx9vIiteKFtxP63jdWkS6b7uUxQI8 MGqTU7e2nrAqk5TRF0T7HGmfZsQHAXRnMgTEvHQpd5Oc76UQHhhe1P1KbmYBcPRVhnrt 0KVaPu5VYz58g+haaWSoWjbYp+3xTMLR6S1OiYslYZDolpNjGgbrHbiy9vqBu9jmEWlp 987MYdpZpGJg4noNsDy8wxu83IqeI7zzXFwXc+yK9HXBDEx2QKIpOqE/QLBjFYQdqkUo vYT/0XFMJQ5Chi4ID9N+yipvc1zqyyK2aNy53NU+lY5+x3kbt7ibm0OfMU6HaK0LoPH+ L+KQ== X-Gm-Message-State: APjAAAUCkv8XcQG/Itc7HhAHkZ49KiDK1Up2HRY6kDGJffvFOgTQT77E EZbru13upd0NlNDjJzJn+Nx9JQ== X-Received: by 2002:a1c:e009:: with SMTP id x9mr7976175wmg.117.1558542335118; Wed, 22 May 2019 09:25:35 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id q15sm8462720wrr.19.2019.05.22.09.25.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 09:25:34 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org Cc: sanyog.r.kale@intel.com, pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH] soundwire: stream: fix bad unlock balance Date: Wed, 22 May 2019 17:25:28 +0100 Message-Id: <20190522162528.5892-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes below warning due to unlocking without locking. ===================================== 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 --- drivers/soundwire/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.21.0 diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index 544925ff0b40..d16268f30e4f 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -814,7 +814,8 @@ static int do_bank_switch(struct sdw_stream_runtime *stream) goto error; } - mutex_unlock(&bus->msg_lock); + if (mutex_is_locked(&bus->msg_lock)) + utex_unlock(&bus->msg_lock); } return ret;