diff options
Diffstat (limited to 'init/do_mounts.c')
-rw-r--r-- | init/do_mounts.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c index eb410083e8e0..a95bbdb2a502 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -207,7 +207,7 @@ done: * bangs. */ -dev_t name_to_dev_t(char *name) +dev_t name_to_dev_t(const char *name) { char s[32]; char *p; @@ -225,9 +225,11 @@ dev_t name_to_dev_t(char *name) #endif if (strncmp(name, "/dev/", 5) != 0) { - unsigned maj, min; + unsigned maj, min, offset; + char dummy; - if (sscanf(name, "%u:%u", &maj, &min) == 2) { + if ((sscanf(name, "%u:%u%c", &maj, &min, &dummy) == 2) || + (sscanf(name, "%u:%u:%u:%c", &maj, &min, &offset, &dummy) == 3)) { res = MKDEV(maj, min); if (maj != MAJOR(res) || min != MINOR(res)) goto fail; @@ -286,6 +288,7 @@ fail: done: return res; } +EXPORT_SYMBOL_GPL(name_to_dev_t); static int __init root_dev_setup(char *line) { |