From aa822e4d9c0f68ff9c7d236cc7c8a88bdf375aea 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 ecf044090..d626d0824 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -3067,7 +3067,7 @@ open_objset(const char *path, const void *tag, objset_t **osp) } sa_os = *osp; - return (0); + return (err); } static void