cdev_mount_default is documented to return error pointers on errors and that's what's done everywhere inside the function, except for errors from the last call to cdev_get_mount_path. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- fs/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fs.c b/fs/fs.c index a9d2cc7088e3..6d047f197640 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -1152,7 +1152,7 @@ const char *cdev_mount_default(struct cdev *cdev, const char *fsoptions) return ERR_PTR(ret); } - return cdev_get_mount_path(cdev); + return cdev_get_mount_path(cdev) ?: ERR_PTR(-ENODEV); } /* -- 2.39.5