mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
sparc64: vcc: Check for IS_ERR() instead of NULL
The tty_alloc_driver() function never returns NULL, it returns error
pointers on error.
Fixes: ce808b7463 ("sparc64: vcc: TTY driver initialization and cleanup")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
cc324d1a3e
commit
c6b4ee9eba
1 changed files with 2 additions and 2 deletions
|
|
@ -1086,9 +1086,9 @@ static int vcc_tty_init(void)
|
|||
pr_info("VCC: %s\n", version);
|
||||
|
||||
vcc_tty_driver = tty_alloc_driver(VCC_MAX_PORTS, VCC_TTY_FLAGS);
|
||||
if (!vcc_tty_driver) {
|
||||
if (IS_ERR(vcc_tty_driver)) {
|
||||
pr_err("VCC: TTY driver alloc failed\n");
|
||||
return -ENOMEM;
|
||||
return PTR_ERR(vcc_tty_driver);
|
||||
}
|
||||
|
||||
vcc_tty_driver->driver_name = vcc_driver_name;
|
||||
|
|
|
|||
Loading…
Reference in a new issue