From eebad33408bd4a5d721e0f2bccb1911418b483c7 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Fri, 14 Oct 2022 22:45:13 -0400 Subject: [PATCH] Fix NULL pointer dereference in zdb Clang's static analyzer complained that we dereference a NULL pointer in dump_path() if we return 0 when there is an error. Reviewed-by: Brian Behlendorf Signed-off-by: Richard Yao Closes #14044 --- cmd/zdb/zdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 4e57538d2234..f424dd771f70 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -2995,7 +2995,7 @@ open_objset(const char *path, void *tag, objset_t **osp) } sa_os = *osp; - return (0); + return (err); } static void