diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index b00f35201132..5eef67358cfb 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -32,6 +32,7 @@ #include #include #include +#include #include static struct kmem_cache *bch2_inode_cache; @@ -1324,6 +1325,9 @@ static char **split_devs(const char *_dev_name, unsigned *nr) char *dev_name = NULL, **devs = NULL, *s; size_t i, nr_devs = 0; + if (strlen(_dev_name) == 0) + return NULL; + dev_name = kstrdup(_dev_name, GFP_KERNEL); if (!dev_name) return NULL;