Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175325
b: refs/heads/master
c: 9e845ab
h: refs/heads/master
i:
  175323: c0fdcc9
v: v3
  • Loading branch information
André Goddard Rosa authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent 9eef660 commit 840c811
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 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: 2a0785ea375fe93cd480599bb40d0c837ff72a2e
refs/heads/master: 9e845abfc8a8973373821aa05302794fd254514b
21 changes: 11 additions & 10 deletions trunk/drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2344,7 +2344,7 @@ static const struct tty_operations uart_ops = {
*/
int uart_register_driver(struct uart_driver *drv)
{
struct tty_driver *normal = NULL;
struct tty_driver *normal;
int i, retval;

BUG_ON(drv->state);
Expand All @@ -2354,13 +2354,12 @@ int uart_register_driver(struct uart_driver *drv)
* we have a large number of ports to handle.
*/
drv->state = kzalloc(sizeof(struct uart_state) * drv->nr, GFP_KERNEL);
retval = -ENOMEM;
if (!drv->state)
goto out;

normal = alloc_tty_driver(drv->nr);
normal = alloc_tty_driver(drv->nr);
if (!normal)
goto out;
goto out_kfree;

drv->tty_driver = normal;

Expand Down Expand Up @@ -2393,12 +2392,14 @@ int uart_register_driver(struct uart_driver *drv)
}

retval = tty_register_driver(normal);
out:
if (retval < 0) {
put_tty_driver(normal);
kfree(drv->state);
}
return retval;
if (retval >= 0)
return retval;

put_tty_driver(normal);
out_kfree:
kfree(drv->state);
out:
return -ENOMEM;
}

/**
Expand Down

0 comments on commit 840c811

Please sign in to comment.