aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init/do_mounts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 8369ffa5f33d..a95bbdb2a502 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -225,10 +225,11 @@ dev_t name_to_dev_t(const char *name)
225#endif 225#endif
226 226
227 if (strncmp(name, "/dev/", 5) != 0) { 227 if (strncmp(name, "/dev/", 5) != 0) {
228 unsigned maj, min; 228 unsigned maj, min, offset;
229 char dummy; 229 char dummy;
230 230
231 if (sscanf(name, "%u:%u%c", &maj, &min, &dummy) == 2) { 231 if ((sscanf(name, "%u:%u%c", &maj, &min, &dummy) == 2) ||
232 (sscanf(name, "%u:%u:%u:%c", &maj, &min, &offset, &dummy) == 3)) {
232 res = MKDEV(maj, min); 233 res = MKDEV(maj, min);
233 if (maj != MAJOR(res) || min != MINOR(res)) 234 if (maj != MAJOR(res) || min != MINOR(res))
234 goto fail; 235 goto fail;