From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D5BF79446 for ; Sun, 13 Aug 2023 21:42:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E988C433C7; Sun, 13 Aug 2023 21:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1691962925; bh=cVcaP475DPfDO5xgHArzZ59pco84P6EIcczICc8hmgs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GmaiNg1WF7NCX08R7KohFHwrTZ2cQdNkEiCM+8QqsLCzXrT1IrD5QkCa9IqYHJvLR UDUu0fHh9VTi3wONj+voOskQDUBtn5+EI0NX8zC0A04kXXok22SSEo4o+tOYp205V6 X+JG7tSPuoBrjZx3ltW0p4jczDZwRvWaG04D/3RQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Olaf Skibbe , Lyude Paul , Karol Herbst Subject: [PATCH 5.10 30/68] drm/nouveau/disp: Revert a NULL check inside nouveau_connector_get_modes Date: Sun, 13 Aug 2023 23:19:31 +0200 Message-ID: <20230813211709.073563418@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230813211708.149630011@linuxfoundation.org> References: <20230813211708.149630011@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Karol Herbst commit d5712cd22b9cf109fded1b7f178f4c1888c8b84b upstream. The original commit adding that check tried to protect the kenrel against a potential invalid NULL pointer access. However we call nouveau_connector_detect_depth once without a native_mode set on purpose for non LVDS connectors and this broke DP support in a few cases. Cc: Olaf Skibbe Cc: Lyude Paul Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/238 Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/245 Fixes: 20a2ce87fbaf8 ("drm/nouveau/dp: check for NULL nv_connector->native_mode") Signed-off-by: Karol Herbst Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230805101813.2603989-1-kherbst@redhat.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -947,7 +947,7 @@ nouveau_connector_get_modes(struct drm_c /* Determine display colour depth for everything except LVDS now, * DP requires this before mode_valid() is called. */ - if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode) + if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS) nouveau_connector_detect_depth(connector); /* Find the native mode if this is a digital panel, if we didn't