bcacheadm: Fix bcacheadm status segfault if no devs given

Fixes DAT-1655

Change-Id: I79cfc78fb8513f3e751332d65310d65020c15e3e
Signed-off-by: Jacob Malevich <jam@daterainc.com>
This commit is contained in:
Jacob Malevich 2014-12-19 15:35:13 -08:00
parent be4e8676b6
commit f8d3f7da8f

View File

@ -590,10 +590,12 @@ int bcache_status(NihCommand *command, char *const *args)
free(sb);
}
if(!seq_sb)
if(!seq_sb) {
printf("Unable to find a superblock\n");
else
return -1;
} else {
printf("%-50s%-15s%-4s\n", "uuid", "state", "tier");
}
for (i = 0; i < seq_sb->nr_in_set; i++) {
char uuid_str[40];