diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 638572996c..af7d15621d 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -6072,6 +6072,9 @@ spa_get_stats(const char *name, nvlist_t **config, *config = NULL; error = spa_open_common(name, &spa, FTAG, NULL, config); + if(error == ENOENT) { + return (error); + } if (spa != NULL) { /* @@ -6116,7 +6119,7 @@ spa_get_stats(const char *name, nvlist_t **config, if (spa == NULL) { mutex_enter(&spa_namespace_lock); spa = spa_lookup(name); - if (spa) + if (spa != NULL) spa_altroot(spa, altroot, buflen); else altroot[0] = '\0';