mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-22 00:00:03 +03:00
cmd_fs_usage: fix null ptr deref
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
b00ac20e76
commit
8d75a97e1a
@ -185,7 +185,7 @@ static void replicas_usage_to_text(struct printbuf *out,
|
|||||||
unsigned dev_idx = r->devs[i];
|
unsigned dev_idx = r->devs[i];
|
||||||
struct dev_name *dev = dev_idx_to_name(dev_names, dev_idx);
|
struct dev_name *dev = dev_idx_to_name(dev_names, dev_idx);
|
||||||
|
|
||||||
durability += dev->durability;
|
durability += dev ? dev->durability : 0;
|
||||||
|
|
||||||
if (i)
|
if (i)
|
||||||
*d++ = ' ';
|
*d++ = ' ';
|
||||||
|
Loading…
Reference in New Issue
Block a user