From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from wxsgout04.xfusion.com (wxsgout04.xfusion.com [36.139.87.180]) (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 6A38E33B6D6 for ; Sun, 2 Aug 2026 10:31:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=36.139.87.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785666695; cv=none; b=ADC6h7Ahott20zFpN5SGNXtQEACAx+/NHq7UlKqIxDRfCa4bb+LKos4thspYlzjd2hsVja3efmls8uRAADGSU271fXctBOTJT/ax+QW+uBnMH8G3iZUtsZtgSVLSbkpP5ACmJRCKR83qo8y3z7NoXock/Y0gih0GjE6NJovzv88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785666695; c=relaxed/simple; bh=JP53AKVYfy8w6mDHpYc1QU9BEOub73QF6+gV2TWJQzY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=sBLxy+PTzsbKoqw9vGlPajpGocA2JLwUunLvk7nhIRS2gZD/F8jWlmD8Oo1+eT2J75t5Ct7PkxMV2leDYwyRNMUyGFHM2FLTWG1zi/WvtbuJWIzwv573RC1Vc1NDJWG9n+XpzTdWQC/g7JTP5nO3kfApd1Nvt4V2dhv7lMk29/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xfusion.com; spf=pass smtp.mailfrom=xfusion.com; arc=none smtp.client-ip=36.139.87.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xfusion.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xfusion.com Received: from wuxpheds03048.xfusion.com (unknown [10.32.143.30]) by wxsgout04.xfusion.com (SkyGuard) with ESMTPS id 4hCb9v0y2wzBR4J5; Sun, 2 Aug 2026 18:08:51 +0800 (CST) Received: from DESKTOP-Q8I2N5U.xfusion.com (10.82.130.100) by wuxpheds03048.xfusion.com (10.32.143.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_RSA_WITH_AES_128_CBC_SHA256) id 15.2.2562.20; Sun, 2 Aug 2026 18:11:19 +0800 From: shechenglong To: , , CC: , , , , , , , , , , , shechenglong Subject: [PATCH] drm/virtio: check return value of vgdev_output_init() Date: Sun, 2 Aug 2026 18:11:08 +0800 Message-ID: <20260802101108.1595-1-shechenglong@xfusion.com> X-Mailer: git-send-email 2.37.1.windows.1 Precedence: bulk X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-ClientProxiedBy: wuxpheds03048.xfusion.com (10.32.143.30) To wuxpheds03048.xfusion.com (10.32.143.30) The return value of vgdev_output_init(), called by=0D virtio_gpu_modeset_init(), is not checked. As a result, modeset=0D initialization continues even if an output fails to initialize.=0D =0D check the return value and return the error to the caller.=0D =0D Signed-off-by: shechenglong =0D ---=0D drivers/gpu/drm/virtio/virtgpu_display.c | 7 +++++--=0D 1 file changed, 5 insertions(+), 2 deletions(-)=0D =0D diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/vir= tio/virtgpu_display.c=0D index 44ffffec550f..f2b98d018c1e 100644=0D --- a/drivers/gpu/drm/virtio/virtgpu_display.c=0D +++ b/drivers/gpu/drm/virtio/virtgpu_display.c=0D @@ -378,8 +378,11 @@ int virtio_gpu_modeset_init(struct virtio_gpu_device *= vgdev)=0D =0D vgdev->ddev->mode_config.fb_modifiers_not_supported =3D true;=0D =0D - for (i =3D 0 ; i < vgdev->num_scanouts; ++i)=0D - vgdev_output_init(vgdev, i);=0D + for (i =3D 0; i < vgdev->num_scanouts; ++i) {=0D + ret =3D vgdev_output_init(vgdev, i);=0D + if (ret)=0D + return ret;=0D + }=0D =0D ret =3D drm_vblank_init(vgdev->ddev, vgdev->num_scanouts);=0D if (ret)=0D --=0D 2.33.0=0D =0D