Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296413
b: refs/heads/master
c: fe9a6b0
h: refs/heads/master
i:
  296411: f2a08f3
v: v3
  • Loading branch information
Al Viro authored and Richard Weinberger committed Mar 24, 2012
1 parent 7afafe6 commit 43a27f6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: da645f3be912a377ada97268e36360b0a4389ab0
refs/heads/master: fe9a6b002988372406baf5aeefc046677782365e
22 changes: 16 additions & 6 deletions trunk/arch/um/drivers/line.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,22 +572,32 @@ int line_config(struct line *lines, unsigned int num, char *str,
{
struct line *line;
char *new;
int n;
char *end;
int n, err;

if (*str == '=') {
*error_out = "Can't configure all devices from mconsole";
return -EINVAL;
}

new = kstrdup(str, GFP_KERNEL);
n = simple_strtoul(str, &end, 0);
if (*end++ != '=') {
*error_out = "Couldn't parse device number";
return -EINVAL;
}
if (n >= num) {
*error_out = "Device number out of range";
return -EINVAL;
}

new = kstrdup(end, GFP_KERNEL);
if (new == NULL) {
*error_out = "Failed to allocate memory";
return -ENOMEM;
}
n = line_setup(lines, num, new, error_out);
if (n < 0)
return n;

err = setup_one_line(lines, n, new, INIT_ONE, error_out);
if (err)
return err;
line = &lines[n];
return parse_chan_pair(line->init_str, line, n, opts, error_out);
}
Expand Down

0 comments on commit 43a27f6

Please sign in to comment.