From nobody Sat Nov 23 20:01:45 2024 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1414915887C for ; Mon, 11 Nov 2024 09:06:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731315977; cv=none; b=jnUY/my+/I7Q/Dt9LxdYcU+RMrrUZH+BlnJmInon4C1oJFFAun24grYmhQcl/XQE0cQXHFVyEiIfeFP9uFQ2SkP1DTJeDUGxrzDkn+L/11jzDCYX6AlsWbek6gAQVx1v6CMmBEy7AeIRWYDKKr+7L/s2kFYkuk0zBNokXRBERQE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731315977; c=relaxed/simple; bh=u5rSxTlaJbSxS6EV4TLb3I+LXVVN2oQUtHH9/BiBiYc=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=sVOFfblX7YXPO37M/LfAbnHfeeNx2pvoh/awGnAJ9VO4omsNx+H+0+uTTCjArusQ144ZPdkfc4LZ0bhXZlC8uu8d0tpj/OGmdWiPrWHyUhtzk1il+l0fHKvEiu+3MCJ/iB4FYsrJjVgK4OQL5O3BvZvH6AQQrNCmmnTZsXJELiI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=rsIpSadc; arc=none smtp.client-ip=209.85.218.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rsIpSadc" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a9a850270e2so799716566b.0 for ; Mon, 11 Nov 2024 01:06:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731315974; x=1731920774; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=apRs0DAdhKBkD9Qp2XtvGYAHxYv4VCBNiG5LEbw4AZU=; b=rsIpSadcdHT/SZwQ4RUjEhHL97pjyFmiuQ8Hs6J1dxaQ8r9Z+eqgtwq6DG5EDY9Y94 p9KeIIUY8v6ADR3K3WeFaHPCqv0MMeNQqQMo7p0kzsJuXiRreKK8ig4rZL10FyTQnDUl 4R5XYRx/HkLhBjoYGS9o/y0JdCTb1GRr/JxBX1NB3gZEtA1IxhXe7IOUQjmD85xIeFpK n4v9FKenWCdyT3k8HfpPHOnYJjzIK6NKSbx+8e1sgP2jWuEWHG0R6ByzcBvxqfu1gxyk /4L7i7BgyaeqC+/El85QA4GPNx/6wGvnIQF6TU4lGim0tU5vy1A0MATqYngXjpLE5HsR QH6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731315974; x=1731920774; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=apRs0DAdhKBkD9Qp2XtvGYAHxYv4VCBNiG5LEbw4AZU=; b=IlLWrgSagg+gzbcvkLbZOuIBdTaqNUUvFi8iNRHxZLa2DznwYD5OjtPzkPE0bvlC0L qPXgSIWi0een6XU+GW0CdZiWeqwKuaQxVSLoE3drjVMmlKfHLojCmvThnDp1KhuYM+UE /lsP2W/WgNRjpYjTYwlBd2q2NvUmVUtUN874nnZlljiKbqXE1NqM0UYpmHOTuoWvMgXU 9xLZ/jTkGZ9WH9CmCYXI4bbci1tR/mGqmrooIiNjCE4sh64DTkZqtnjWq5q4CkGcuOdW nr+Yt/Xc/5ECxJDYycd8bVdTLs2rkdxPknRdhWvBNElR2Dx5udxIJROse+2aMMbZ27TZ /q7Q== X-Forwarded-Encrypted: i=1; AJvYcCWi7tbPehiPr43iCD+T28A3eVCN/yZ6HSpWNu/grw073ll1dqbNQ6oAiDXBDNo+rigOmQgI94iGIMItplQ=@vger.kernel.org X-Gm-Message-State: AOJu0YybLFJ1UPnVictdA+mRMefWAvVghFBJuXBQ/FQ1TmzTgn1wCIT+ Zwwz59TW5eQp25FHhjeoXRjbMUHjgemTvldL8sCGLTfEPUb09rwWJZ6v0i2z5no= X-Google-Smtp-Source: AGHT+IG01DvV4fVYHey4p2gLJdP8gIwgetBzZShx8jJbLbuJv9DbED9jmrm294gcWaav324B9xGGuw== X-Received: by 2002:a17:907:c15:b0:a99:8a0e:8710 with SMTP id a640c23a62f3a-a9eefee6682mr1056624666b.14.1731315974411; Mon, 11 Nov 2024 01:06:14 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9ee0a4b82csm579023566b.67.2024.11.11.01.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 01:06:14 -0800 (PST) Date: Mon, 11 Nov 2024 12:06:10 +0300 From: Dan Carpenter To: Sean Anderson Cc: Laurent Pinchart , Tomi Valkeinen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Michal Simek , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH next] drm: zynqmp_dp: Unlock on error in zynqmp_dp_bridge_atomic_enable() Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" We added some locking to this function, but accidentally forgot to unlock if zynqmp_dp_mode_configure() failed. Use a guard lock to fix it. Fixes: a7d5eeaa57d7 ("drm: zynqmp_dp: Add locking") Signed-off-by: Dan Carpenter Reviewed-by: Laurent Pinchart Reviewed-by: Sean Anderson --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp= _dp.c index 25c5dc61ee88..0bea908b281e 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1537,7 +1537,7 @@ static void zynqmp_dp_bridge_atomic_enable(struct drm= _bridge *bridge, =20 pm_runtime_get_sync(dp->dev); =20 - mutex_lock(&dp->lock); + guard(mutex)(&dp->lock); zynqmp_dp_disp_enable(dp, old_bridge_state); =20 /* @@ -1598,7 +1598,6 @@ static void zynqmp_dp_bridge_atomic_enable(struct drm= _bridge *bridge, zynqmp_dp_write(dp, ZYNQMP_DP_SOFTWARE_RESET, ZYNQMP_DP_SOFTWARE_RESET_ALL); zynqmp_dp_write(dp, ZYNQMP_DP_MAIN_STREAM_ENABLE, 1); - mutex_unlock(&dp->lock); } =20 static void zynqmp_dp_bridge_atomic_disable(struct drm_bridge *bridge, --=20 2.45.2