From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE583C531C7 for ; Thu, 23 Jul 2026 09:28:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F41610E57D; Thu, 23 Jul 2026 09:28:18 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="HctHJSfm"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7A4E410E57D; Thu, 23 Jul 2026 09:28:17 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id B1193600AD; Thu, 23 Jul 2026 09:28:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBF031F000E9; Thu, 23 Jul 2026 09:28:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784798896; bh=3PNdn0S7w0qgb/ZvuAljb2K/5ST6bGlNkAYjIoGbaks=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=HctHJSfmjQ+4RIeZr+ACRRACcOSpUa7Ae5mgt7DI0cu5vf2GQnhDk4FCPiXcTHUWx SoCybiusZQIxbncufPAwxr1Z+0GbDPJMYAXxwcmX+6fKbzhfk7Kyey9zxTL69cbm1o una7h0vSMlfdw9drFExJvjiLBZLTs8LDxgSBjTP3hlivLWjtU22S9lQa/y70OtlZzg Cw0TRlvUGpbXMrvQKm4YnuUdDfQ4Lip3gUeYEG+QCZR3/LxT3+PYxqAvjdXqWcWrVZ GK4/VeEbn+dVnWGTyJmDew/ENTg6VFid2ibcQkNv3y/D/7FyR1EZwWHmHKs9FBTf3H giRqO3tXoIN/w== Date: Thu, 23 Jul 2026 11:27:51 +0200 From: Andi Shyti To: Sebastian Brzezinka Cc: dri-devel@lists.freedesktop.org, maarten.lankhorst@linux.intel.com, andi.shyti@linux.intel.com, krzysztof.karas@intel.com, krzysztof.niemiec@intel.com, intel-gfx@lists.freedesktop.org Subject: Re: [PATCH] drm/fb-helper: guard against NULL fb_helper->funcs in restore path Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Hi Sebastian, On Thu, Jul 16, 2026 at 12:14:33PM +0200, Sebastian Brzezinka wrote: > When a driver's fbdev probe callback fails before assigning > fb_helper->funcs (e.g. i915's intel_fbdev_driver_fbdev_probe() bailing > out early on a DMA/GGTT pin failure), the fbdev client stays registered > with fb_helper->funcs == NULL. Any later restore, such as on drm fd close > via drm_client_dev_restore() -> drm_fbdev_client_restore(), reaches > __drm_fb_helper_restore_fbdev_mode_unlocked() and unconditionally > dereferences fb_helper->funcs->fb_restore, causing a NULL pointer > dereference. > > Guard the fb_restore call with a NULL check on fb_helper->funcs. > > Fixes: 2ef5754c9649 ("drm/i915/display: fbdev: Move custom restore code to new callback") > Signed-off-by: Sebastian Brzezinka Reviewed-by: Andi Shyti Thanks, Andi