From dc8c2f615852cb79d3c4cae6c1fb738c7f4a793c Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Thu, 22 Dec 2022 14:50:09 -0500 Subject: [PATCH] FreeBSD: Fix potential boot panic with bad label vdev_geom_read_pool_label() can leave NULL in configs. Check for it and skip consistently when generating rootconf. Reviewed-by: Alexander Motin Signed-off-by: Ryan Moeller Closes #14291 --- module/os/freebsd/zfs/spa_os.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/os/freebsd/zfs/spa_os.c b/module/os/freebsd/zfs/spa_os.c index 45ea10bb48..449c162481 100644 --- a/module/os/freebsd/zfs/spa_os.c +++ b/module/os/freebsd/zfs/spa_os.c @@ -94,6 +94,8 @@ spa_generate_rootconf(const char *name) for (i = 0; i < count; i++) { uint64_t txg; + if (configs[i] == NULL) + continue; txg = fnvlist_lookup_uint64(configs[i], ZPOOL_CONFIG_POOL_TXG); if (txg > best_txg) { best_txg = txg;