提交 c6b4ee9e 编写于 作者: D Dan Carpenter 提交者: David S. Miller

sparc64: vcc: Check for IS_ERR() instead of NULL

The tty_alloc_driver() function never returns NULL, it returns error
pointers on error.

Fixes: ce808b74 ("sparc64: vcc: TTY driver initialization and cleanup")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 cc324d1a
...@@ -1086,9 +1086,9 @@ static int vcc_tty_init(void) ...@@ -1086,9 +1086,9 @@ static int vcc_tty_init(void)
pr_info("VCC: %s\n", version); pr_info("VCC: %s\n", version);
vcc_tty_driver = tty_alloc_driver(VCC_MAX_PORTS, VCC_TTY_FLAGS); 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"); pr_err("VCC: TTY driver alloc failed\n");
return -ENOMEM; return PTR_ERR(vcc_tty_driver);
} }
vcc_tty_driver->driver_name = vcc_driver_name; vcc_tty_driver->driver_name = vcc_driver_name;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册