From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 27 Jan 2026 13:14:18 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vkhxb-005tNJ-0b for lore@lore.pengutronix.de; Tue, 27 Jan 2026 13:14:18 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1vkhxY-0001KM-BV; Tue, 27 Jan 2026 13:14:16 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vkhxV-0001Ga-Rq for oss-tools@pengutronix.de; Tue, 27 Jan 2026 13:14:13 +0100 Received: from dude06.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::5c]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vkhxW-002k9h-0x for oss-tools@pengutronix.de; Tue, 27 Jan 2026 13:14:13 +0100 Received: from ejo by dude06.red.stw.pengutronix.de with local (Exim 4.98.2) (envelope-from ) id 1vkhxV-0000000Enxv-2OCG for oss-tools@pengutronix.de; Tue, 27 Jan 2026 13:14:13 +0100 From: =?UTF-8?q?Enrico=20J=C3=B6rns?= To: oss-tools@pengutronix.de Date: Tue, 27 Jan 2026 13:12:59 +0100 Message-ID: <20260127121322.3332573-3-ejo@pengutronix.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260127121322.3332573-1-ejo@pengutronix.de> References: <20260127121322.3332573-1-ejo@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [OSS-Tools] [PATCH dt-utils 3/5] libdt: error handling for udev read of ID_PART_TABLE_TYPE X-BeenThere: oss-tools@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: Pengutronix Public Open-Source-Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "OSS-Tools" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: oss-tools-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Since the code does not differentiate between not being able to detect the partition type and being non-GPT, at least print an error message if udev_device_get_property_value() returned NULL. Signed-off-by: Enrico Jörns --- src/libdt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libdt.c b/src/libdt.c index 72e8ab4..1bef154 100644 --- a/src/libdt.c +++ b/src/libdt.c @@ -2337,6 +2337,9 @@ static int cdev_from_block_device(struct udev_device *dev, cdev->devpath = strdup(udev_device_get_devnode(best_match)); part_type = udev_device_get_property_value(best_match, "ID_PART_TABLE_TYPE"); + if (!part_type) { + fprintf(stderr, "Can't read property ID_PART_TABLE_TYPE\n"); + } cdev->is_gpt_partitioned = part_type && !strcmp(part_type, "gpt"); } -- 2.47.3