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 6403EEA3C4E for ; Thu, 9 Apr 2026 13:23:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ABCF610E7EE; Thu, 9 Apr 2026 13:23:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="k6qDN9lG"; 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 BD52D10E7EE for ; Thu, 9 Apr 2026 13:23:20 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id A6EAD60127; Thu, 9 Apr 2026 13:23:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 111C3C4CEF7; Thu, 9 Apr 2026 13:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775740999; bh=beoClJMSHoxdJzdDvk8BWy/7r7zUQ1L8OLTWlMTphLU=; h=From:To:Cc:Subject:Date:From; b=k6qDN9lGMnqcHHelhAtV6ZO1jU/c+cTqANfB5XearxPDpe0gMXG9lw4X2Mamnnf3y Avc9cyjyZPuxAwzwyf38z2t/Fxo75zf18h9OCdp5qI7lcFZWSFOprZJz9dMnOciaLJ 88gkH7oog7jxZavMXnc9hlzo9j06Idr7te3swR48= From: Greg Kroah-Hartman To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Helge Deller , stable Subject: [PATCH] fbdev: tdfxfb: avoid divide-by-zero on FBIOPUT_VSCREENINFO Date: Thu, 9 Apr 2026 15:23:14 +0200 Message-ID: <2026040913-despite-entering-a017@gregkh> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=970; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=beoClJMSHoxdJzdDvk8BWy/7r7zUQ1L8OLTWlMTphLU=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnXVzhufl+cOCN6ablScfK6B6GK/48abf9yUnjqt4e7M jcuz2qM7ohlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJPGdmmGd3qNDORXimyk+B eIa0gF5BviVsSQwLFpdpXG4Sfdd3T+vfseU+wgblBjO4AA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Much like commit 19f953e74356 ("fbdev: fb_pm2fb: Avoid potential divide by zero error"), we also need to prevent that same crash from happening in the udlfb driver as it uses pixclock directly when dividing, which will crash. Cc: Helge Deller Assisted-by: gregkh_clanker_t1000 Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/tdfxfb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/video/fbdev/tdfxfb.c b/drivers/video/fbdev/tdfxfb.c index 51ebe78359ec..531fb8478e20 100644 --- a/drivers/video/fbdev/tdfxfb.c +++ b/drivers/video/fbdev/tdfxfb.c @@ -496,6 +496,9 @@ static int tdfxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) } } + if (!var->pixclock) + return -EINVAL; + if (PICOS2KHZ(var->pixclock) > par->max_pixclock) { DPRINTK("pixclock too high (%ldKHz)\n", PICOS2KHZ(var->pixclock)); -- 2.53.0