From: Luca Boccassi Date: Fri, 21 Nov 2025 17:53:46 +0000 (+0000) Subject: test: check for all errors in test-reread-partition-table X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=12d2abe0827ad62652d0cb1791c89f3d2adbb280;p=thirdparty%2Fsystemd.git test: check for all errors in test-reread-partition-table Otherwise if opening the loop dev fails, the test segfaults dereferencing a NULL variable later Follow-up for 757887d01dd96125be1774f4b23b12f2fbda9a8b --- diff --git a/src/test/test-reread-partition-table.c b/src/test/test-reread-partition-table.c index 5f465e61db2..cff31f41a1e 100644 --- a/src/test/test-reread-partition-table.c +++ b/src/test/test-reread-partition-table.c @@ -70,6 +70,8 @@ TEST(rereadpt) { LOCK_EX, &loop); if (ERRNO_IS_NEG_PRIVILEGE(r) || ERRNO_IS_NOT_SUPPORTED(r)) return (void) log_tests_skipped("loopback block devices not available"); + if (r < 0) + return (void) log_error_errno(r, "Failed to create loop device: %m"); _cleanup_free_ char *p = NULL; ASSERT_OK(partition_node_of(loop->node, 1, &p));