Skip to content

Commit

Permalink
char: hvc: check for error case
Browse files Browse the repository at this point in the history
hvc_alloc() may fail, if so exit from init() with error.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
  • Loading branch information
Vasiliy Kulikov authored and Chris Metcalf committed Oct 14, 2010
1 parent 77d2330 commit 6496a5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/char/hvc_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ console_initcall(hvc_tile_console_init);

static int __init hvc_tile_init(void)
{
hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128);
return 0;
struct hvc_struct *s;
s = hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128);
return IS_ERR(s) ? PTR_ERR(s) : 0;
}
device_initcall(hvc_tile_init);

0 comments on commit 6496a5c

Please sign in to comment.