Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

char: hvc: check for error case

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>

authored by

Vasiliy Kulikov and committed by
Chris Metcalf
6496a5c9 77d23303

+3 -2
+3 -2
drivers/char/hvc_tile.c
··· 61 61 62 62 static int __init hvc_tile_init(void) 63 63 { 64 - hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128); 65 - return 0; 64 + struct hvc_struct *s; 65 + s = hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128); 66 + return IS_ERR(s) ? PTR_ERR(s) : 0; 66 67 } 67 68 device_initcall(hvc_tile_init);