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 8885C377A82; Thu, 20 Aug 2026 16:35:27 +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=1787243728; cv=none; b=VvV8f9Fw8v52mIW+wSHe2S3VmDxtU8cxa0MN6GuTsYxhAec9M3ljQpzpK5Fk+9AkhciXZHgXYFxEGRSo6LAHtrxNTLsF/pCYLe6RMgXtZCSodmQpkI3y9RXs3BHUhdemqiyIf7PljR/vu2sUL1xBIv8oO6VUVwhPxhOZv5H5jzc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787243728; c=relaxed/simple; bh=/hgP0ywn/zosyZsjm5AkWJ+cnzCqrWnZbR5cbLBOGuM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sJGDrlkPwAzT8xR2BML795svaK5GYTrItIWdeWM1igk8Q0ARnyF7IZRFR0h0X2VhuPLM/Oqv+gWOTo2iEuwg1ghisvWUhRvsInnoZYe9CbPnnFfYymlXs/7vCm5LSbVYH9x6eE4Az4JcgcSkeG9lLTclRlcQizFprzVNzpnCbic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Bq+2n6P5; 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="Bq+2n6P5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98ED91F000E9; Thu, 20 Aug 2026 16:35:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787243727; bh=/GfGjkjsE9g+O05k/zlnQQKZ1MHzALZ8UeszEwi48CU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Bq+2n6P5gTQVMKWXkWnnqU7I+YmzM3A8kbShLV/I/7SaRkBCsLugrRu+FE0zWKjxm KZw6TtNBl8f2FTUX7uy4TIkPt99UjJYXjVk+xcsdU21RIOABmYDVQLdfjj5fv8kFKS Y3t0reFHr6dvnsDhaWl/DaxOfgXrv65L7kZDU3u0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Andy Shevchenko , Jiangshan Yi , Sasha Levin Subject: [PATCH 5.15 194/272] serial: 8250_mid: Fix NULL function pointer dereference on DNV/ICX-D/SNR platforms Date: Thu, 20 Aug 2026 16:56:18 +0200 Message-ID: <20260820145237.292525500@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145231.229664293@linuxfoundation.org> References: <20260820145231.229664293@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiangshan Yi [ Upstream commit 7fb13fd7e9a59a37cd911efff83abe19e3ee029d ] Commit b1b4efea05a5 ("serial: 8250_mid: Disable DMA for selected platforms") replaced the dnv_board setup and exit callbacks with PTR_IF(false, ...), which evaluates to NULL. However, the three call sites in mid8250_probe() and mid8250_remove() unconditionally dereference these function pointers without NULL checks, causing a NULL pointer dereference (kernel oops) on any Denverton (DNV), Ice Lake Xeon D (ICX-D/CDF), or Snowridge (SNR) platform. Fix this by adding the missing NULL checks before calling the setup and exit callbacks. Fixes: b1b4efea05a5 ("serial: 8250_mid: Disable DMA for selected platforms") Cc: stable Reviewed-by: Andy Shevchenko Signed-off-by: Jiangshan Yi Link: https://patch.msgid.link/20260715073546.1875083-1-yijiangshan@kylinos.cn Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_mid.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) --- a/drivers/tty/serial/8250/8250_mid.c +++ b/drivers/tty/serial/8250/8250_mid.c @@ -319,9 +319,11 @@ static int mid8250_probe(struct pci_dev if (!uart.port.membase) return -ENOMEM; - ret = mid->board->setup(mid, &uart.port); - if (ret) - return ret; + if (mid->board->setup) { + ret = mid->board->setup(mid, &uart.port); + if (ret) + return ret; + } ret = mid8250_dma_setup(mid, &uart); if (ret) @@ -337,7 +339,8 @@ static int mid8250_probe(struct pci_dev return 0; err: - mid->board->exit(mid); + if (mid->board->exit) + mid->board->exit(mid); return ret; } @@ -347,7 +350,8 @@ static void mid8250_remove(struct pci_de serial8250_unregister_port(mid->line); - mid->board->exit(mid); + if (mid->board->exit) + mid->board->exit(mid); } static const struct mid8250_board pnw_board = {