From nobody Fri Oct 2 01:57:23 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 1C0CA3DE431 for ; Thu, 6 Aug 2026 07:55:07 +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=1786002910; cv=none; b=bUFLg2dTOcNqm2sAQghS8X1iqjHbPM6P9fZYqm4BcuLHLXiBwyKYthRL6B5KJhMSWvxsCBAem03YrEjgbu+CKwrPU+oKosbwjrxyCMdYFf6ff155Az9O7iNmBmS92qqbRsRtC9uqdj8LdfX6FrGqwPLsLyjkHxT9z2Vsa4IjZ30= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786002910; c=relaxed/simple; bh=1r6s88r1lhliw4uEzu9DE1Vg0JIeucx1G/y7R9ydAUU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=lXOk97R0eMQ6NQBpwpL0HHAVbz89eRDS/GBRqWOS+BW3JvaPE0e+JnGV+h+Uo1SHwsHAHd91b1lwPLdgizpYXHxbA526vzYxcFcIxqiMYx4H3w1mbDvrDiXICwjYZ/9WAneEvWvAJDZmm1OItvyvyV8lhk0BoAFlv1ZrW7yE3Z4= 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: 203f1f7c916c11f1aa26b74ffac11d73-20260806 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:e75442c5-6119-4199-a808-13b73d1dd4b1,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:e7bac3a,CLOUDID:b58997b5befc7912ed837bbde77ea157,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|136|850|865|898,TC:nil,Content:0|15| 50,EDM:-3|-100,IP:nil,URL:0,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 X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 203f1f7c916c11f1aa26b74ffac11d73-20260806 X-User: gonglinkai@kylinos.cn Received: from localhost.localdomain [(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 241219707; Thu, 06 Aug 2026 15:55:00 +0800 From: Linkai Gong To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Kyungmin Park , Andrzej Hajda , Thierry Reding , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Linkai Gong Subject: [PATCH] drm/mipi-dsi: fix UAF on device_add() failure Date: Thu, 6 Aug 2026 15:54:52 +0800 Message-Id: <20260806075452.2361689-1-gonglinkai@kylinos.cn> X-Mailer: git-send-email 2.25.1 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" mipi_dsi_device_alloc() calls device_initialize(). On mipi_dsi_device_add() failure the error path used kfree() instead of put_device(), skipping mipi_dsi_dev_release(). Fixes: 068a00233969 ("drm: Add MIPI DSI bus support") Signed-off-by: Linkai Gong --- drivers/gpu/drm/drm_mipi_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 3ac1dd5ad640..1b4c0acbd30d 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -233,7 +233,7 @@ mipi_dsi_device_register_full(struct mipi_dsi_host *hos= t, ret =3D mipi_dsi_device_add(dsi); if (ret) { dev_err(host->dev, "failed to add DSI device %d\n", ret); - kfree(dsi); + put_device(&dsi->dev); return ERR_PTR(ret); } =20 --=20 2.25.1