diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/do_mounts.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c index eb410083e8e0..8369ffa5f33d 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c | |||
@@ -207,7 +207,7 @@ done: | |||
207 | * bangs. | 207 | * bangs. |
208 | */ | 208 | */ |
209 | 209 | ||
210 | dev_t name_to_dev_t(char *name) | 210 | dev_t name_to_dev_t(const char *name) |
211 | { | 211 | { |
212 | char s[32]; | 212 | char s[32]; |
213 | char *p; | 213 | char *p; |
@@ -226,8 +226,9 @@ dev_t name_to_dev_t(char *name) | |||
226 | 226 | ||
227 | if (strncmp(name, "/dev/", 5) != 0) { | 227 | if (strncmp(name, "/dev/", 5) != 0) { |
228 | unsigned maj, min; | 228 | unsigned maj, min; |
229 | char dummy; | ||
229 | 230 | ||
230 | if (sscanf(name, "%u:%u", &maj, &min) == 2) { | 231 | if (sscanf(name, "%u:%u%c", &maj, &min, &dummy) == 2) { |
231 | res = MKDEV(maj, min); | 232 | res = MKDEV(maj, min); |
232 | if (maj != MAJOR(res) || min != MINOR(res)) | 233 | if (maj != MAJOR(res) || min != MINOR(res)) |
233 | goto fail; | 234 | goto fail; |
@@ -286,6 +287,7 @@ fail: | |||
286 | done: | 287 | done: |
287 | return res; | 288 | return res; |
288 | } | 289 | } |
290 | EXPORT_SYMBOL_GPL(name_to_dev_t); | ||
289 | 291 | ||
290 | static int __init root_dev_setup(char *line) | 292 | static int __init root_dev_setup(char *line) |
291 | { | 293 | { |