Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3416617pxj; Mon, 24 May 2021 06:21:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTIMkcUorxBViW6WYt92WSSFnelhB/tg6O9AyPFjyoArtr0787v1v+Rjmpj9Py6tM3iquC X-Received: by 2002:a17:907:927:: with SMTP id au7mr23905662ejc.267.1621862489175; Mon, 24 May 2021 06:21:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621862489; cv=none; d=google.com; s=arc-20160816; b=G8sqakexpA1veHejFSeOER4Mm5NLKnsqsj5oIIeguAIjwZgadzBVf2iXvd0VCwJRpF Tvc8Bi9h0bAEqbf13x3d6tWIVhHo+vz1wHYhGBdE8LsZHU0PuGEqfsdTb4M4Xic5bZjI BJUfkAGfFU++g+RZG1VxdDEUHNqWqErKj9UXrd6N+Svic3obrIzFq/QsztzGroSMfTxk VdrzfQw1Ri9Y81v35XdbGngZcvJMRpiKnnc4+A/RCK8s49IPn1XWoggA9SbOev2jxMbw mmvFbvpNaHuLgavoxoDm7QUXN8RZj63Mzr+aFBTlYntgxpJvtW7M6a4h8pI29/jmBLGz Ej7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=A4U8f622y15xN+ZagXBG9NpEC5YDva9tV4Lav/1ucwM=; b=zcSAcPnUrH2vEyZSiUvV1nefrvMn8RKJ+gIeT3HsZoiawqKmdeuPtIdBvqi7Woqqty 2h+sjkUD0uejucru1cmW+aiRGjdWrX/UhVs8snjLIk1vQPnTHMpfZrH7xtvIh7R4f0HB yg2UG4GEylZJJCVDezp6EorSZpXu6BEin7ATDzc8v6Q+gVuN4lWFBEAyFGk7PJ7fXMCS +I5BELYWTh4wErYgapMaDqpOzGrqxrT5CQdl0E77HX4XSeXIJvULZ4YLu6D8dC23nrx2 ftbtbo9yeBlLXJyHX16iUQfN2287+VFOPh5j3ZppXb+WqbsrNLADu6D2i9lcATf6UAoZ MWEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=F3ynUO4A; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=jzIUuTKn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l16si14121468edj.405.2021.05.24.06.21.05; Mon, 24 May 2021 06:21:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=F3ynUO4A; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=jzIUuTKn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232764AbhEXNU1 (ORCPT + 99 others); Mon, 24 May 2021 09:20:27 -0400 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]:37691 "EHLO wnew3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbhEXNU0 (ORCPT ); Mon, 24 May 2021 09:20:26 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 8A391395B; Mon, 24 May 2021 09:18:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 24 May 2021 09:18:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm2; bh=A4U8f622y15xN+ZagXBG9NpEC5 YDva9tV4Lav/1ucwM=; b=F3ynUO4APQaMxLO/ocrADPqrX6M27XLkniI2nEhnbj aajvXV6vvOKgSEAVvsP/4L600n9a4/MeUZop4nGHymNHJ9I9qeWDkMUzH2YwuR/x jxD2WIbA9mSTPMNFNaJZxAaLun4cWMRbTuh49L9+5/UeZ6pv30yED+lQ24N+ygn+ oxZ4pfaD3GgyvYf2BJvOdbvkc0Vhx/o7f17iX1jziXzqjKL35KeTLz9TATv3uIlW nR7UoVEDkYKC+Yaq7Cus6mSBBjCY2o7GjrHWvsNFAiyiiq996vQ61AYy5e70YK2Y 4h9Lkv1Am3AWkQVdsABgwSNvsiyBZ8OV5OL0yuOeIzwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=A4U8f622y15xN+Zag XBG9NpEC5YDva9tV4Lav/1ucwM=; b=jzIUuTKnJfSXe7D9TrvlpHwRUFH+2/S9i pzlS0SNUF5ddkhNkJQ9qQSZx2gpAP89Si6joYT+wQ5N5uept7EPi13ostt4f9+CZ nrRVuWDIO1NlMZ1mcQo8WAiA8xDKxI45pF/c7gKdbInAZF4hHSi+PxuezivJG0TT ZyGJgWLoJlUIkb0Ak8u+KPTv4x7FbulGWerKZ95LakFglRyNV6zKgHp4Q+NsdunZ Hsna8g5QR8buCa54QsWtt7A44szBWcDDGyXJ4Q1qcTgnfBx3G63ipb3XswOYUt6j qXJDTWDeQoHrOVP2O9vyk70BwX7+RDj+duobk541KnIZSThwgtKmg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejledgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhmvgcu tfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrthhtvg hrnhepjeffheduvddvvdelhfegleelfffgieejvdehgfeijedtieeuteejteefueekjeeg necukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 May 2021 09:18:53 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: Eric Anholt , linux-kernel@vger.kernel.org, Linus Wallei , Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , Daniel Vetter , Hans Verkuil , Maxime Ripard Subject: [PATCH 1/2] drm/vc4: hdmi: Fix error path of hpd-gpios Date: Mon, 24 May 2021 15:18:51 +0200 Message-Id: <20210524131852.263883-1-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the of_get_named_gpio_flags call fails in vc4_hdmi_bind, we jump to the err_unprepare_hsm label. That label will then call pm_runtime_disable and put_device on the DDC device. We just retrieved the DDC device, so the latter is definitely justified. However at that point we still haven't called pm_runtime_enable, so the call to pm_runtime_disable is not supposed to be there. Fixes: 10ee275cb12f ("drm/vc4: prepare for CEC support") Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index c27b287d2053..ccc6c8079dc6 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2039,7 +2039,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) &hpd_gpio_flags); if (vc4_hdmi->hpd_gpio < 0) { ret = vc4_hdmi->hpd_gpio; - goto err_unprepare_hsm; + goto err_put_ddc; } vc4_hdmi->hpd_active_low = hpd_gpio_flags & OF_GPIO_ACTIVE_LOW; @@ -2080,8 +2080,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi_connector_destroy(&vc4_hdmi->connector); err_destroy_encoder: drm_encoder_cleanup(encoder); -err_unprepare_hsm: pm_runtime_disable(dev); +err_put_ddc: put_device(&vc4_hdmi->ddc->dev); return ret; -- 2.31.1