From nobody Mon Sep 28 18:36:19 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (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 49D4F38D3FD; Thu, 20 Aug 2026 06:00:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787205637; cv=none; b=gCXTHb10cr48h4PIKr363RWlKu7BJOkgDW1qvxglqPuCAHNsO4tihJI6amZF+Lh8l/p7WSo1wFBOuS4SfM7WuTceLT3nkcHKLGXDSUu/P3cM67oCfCwfOFPOW+kRh29fESNANIsyN03nqHjhaCz7p5DH+37r2kLpw2EvhmdJvbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787205637; c=relaxed/simple; bh=xElA6E10uUi9yZQnU+2OiO/da7ibJP07YNyEPSnMfTY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NoIXKXzfZFpdTcnZAOMos6dPimNJM/yVKHWOI0WeH96Yc+b5WSwZoAiPwhoYJl9fSjfhjizrOGeoBSwsnsEy+nSIW/w3uR5SoqD1vFB2+9bryUMzmL7VQ7bBYTNhnLrWL8pheyu9DeDnNWd2czHwqrM34WkhWwIncbq7G8b0PAY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 71ec5d589c5c11f19a56ed5b684f684d-20260820 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.19,REQID:efee74a8-2a7e-4cb1-a816-6b8c27cfee85,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:7db8b62,CLOUDID:1288cbc57c99250d7bddb12c354bae79,BulkI D:nil,BulkQuantity:0,SF:102|136|865|898,TC:nil,Content:0|15|50,EDM:-3|-100 ,IP:nil,URL:99|1,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0 ,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULS X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 71ec5d589c5c11f19a56ed5b684f684d-20260820 X-User: yuebingkun@kylinos.cn Received: from tushenkeke2-pc.. [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 628903182; Thu, 20 Aug 2026 14:00:28 +0800 From: Yue Bing Kun To: Helge Deller Cc: Nathan Chancellor , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] fbdev: platinumfb: add error checking for ioremap calls Date: Thu, 20 Aug 2026 14:00:26 +0800 Message-ID: <20260820060026.217814-1-yuebingkun@kylinos.cn> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: BingKun Yue The ioremap() and ioremap_wt() calls in platinumfb_probe() were not checked for failure. If any of these mappings fail, the driver would dereference NULL pointers, leading to a kernel panic. Add proper error checking and use goto-based cleanup to avoid code duplication across the error paths. Reported-by: Nathan Chancellor Link: https://lore.kernel.org/linux-fbdev/20260819235918.GA2021182@ax162/ Signed-off-by: BingKun Yue --- drivers/video/fbdev/platinumfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/platinumfb.c b/drivers/video/fbdev/platinu= mfb.c index fdffadcc3e73..f74c937c839f 100644 --- a/drivers/video/fbdev/platinumfb.c +++ b/drivers/video/fbdev/platinumfb.c @@ -320,7 +320,7 @@ static void platinum_init_info(struct fb_info *info, fb_alloc_cmap(&info->cmap, 256, 0); =20 /* Fill fix common fields */ - strscpy(info->fix.id, "platinum", sizeof(info->fix.id)); + strcpy(info->fix.id, "platinum"); info->fix.mmio_start =3D pinfo->platinum_regs_phys; info->fix.mmio_len =3D 0x1000; info->fix.type =3D FB_TYPE_PACKED_PIXELS; --=20 2.43.0