From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 384CD1B7910; Wed, 20 May 2026 17:59:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779299943; cv=none; b=iutMsOZD1lDGWfJmmtAMFw44W+KuQhcDa+jAKmRVrlxboXgFxbvg8Z4hcInOVOA6rjhUTiQL+ztU9oxF0tSsaWCDxgp7JD2lP+fsPP/au2K0cL4XhpIX2VgHZkL9ipC4eAGjrwbQrcVn49u3kuxle0QMLqNPZKlwoOVVpCS5LGs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779299943; c=relaxed/simple; bh=PeMVe2R380pqXhuGEgBAUhr6N45wGd9rwhZVledB9SY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KyH8Kruvzs/nl5OsawnJcCQkAlc1S4XUX4/VpqEnNDAcvkcHn/du2tbBkHzWBcvG4ctPCfZsOSraRvQZQ45D4Cm1WMWixQKzBcm0ei0vx86YgLOkC/gXlM3Akq12bYGS//kQN6+VqQCzKYqzEYY9RvAv0q5Ukm0G8lW0MLaLb64= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dEmizvJ4; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="dEmizvJ4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EA511F000E9; Wed, 20 May 2026 17:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779299941; bh=EsaCqQXF7V0WALUmouj+TiA6DXMRN17x3l2+kRqlX/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dEmizvJ4AHmVGndTSOz1zRaxeg7SpYl5Lxct16m0ezF9W9ZqGd95x9Iz3CTY9Ua8u ioZJQrlwGAUwVTPDNANLxiEZtsBM9dvwaDn8qOoIfcscyQw4eXMryGf0d3PFw55zTv 5bKTKmikkIzQe/UO9qxroEH7YuNJ7j8YNZjeisiw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Patrik Jakobsson , Johan Hovold Subject: [PATCH 6.18 946/957] drm/gma500/oaktrail_lvds: fix hang on init failure Date: Wed, 20 May 2026 18:23:49 +0200 Message-ID: <20260520162155.115479097@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162134.554764788@linuxfoundation.org> References: <20260520162134.554764788@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit 657a091ab6d01d0091b77660c75cfed573c9a53e upstream. The LVDS init code looks up an I2C adapter using i2c_get_adapter() and tries to read the EDID before falling back to allocating and registering its own adapter. The error handling does not separate these cases so on a late init failure it will try to deregister and free also an adapter that had previously been registered. Since i2c_get_adapter() takes another reference to the adapter, deregistration hangs indefinitely while waiting for the reference to be released. Fix this by only destroying adapters allocated during LVDS init on errors. Fixes: a57ebfc0b4da ("drm/gma500: Make oaktrail lvds use ddc adapter from drm_connector") Cc: stable@vger.kernel.org # 6.0 Cc: Patrik Jakobsson Signed-off-by: Johan Hovold Signed-off-by: Patrik Jakobsson Link: https://patch.msgid.link/20260508144446.59722-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/gma500/oaktrail_lvds.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/gma500/oaktrail_lvds.c +++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c @@ -292,7 +292,7 @@ void oaktrail_lvds_init(struct drm_devic { struct gma_encoder *gma_encoder; struct gma_connector *gma_connector; - struct gma_i2c_chan *ddc_bus; + struct gma_i2c_chan *ddc_bus = NULL; struct drm_connector *connector; struct drm_encoder *encoder; struct drm_psb_private *dev_priv = to_drm_psb_private(dev); @@ -420,7 +420,8 @@ out: err_unlock: mutex_unlock(&dev->mode_config.mutex); - gma_i2c_destroy(to_gma_i2c_chan(connector->ddc)); + if (!IS_ERR_OR_NULL(ddc_bus)) + gma_i2c_destroy(ddc_bus); drm_encoder_cleanup(encoder); err_connector_cleanup: drm_connector_cleanup(connector);