提交 c93f0940 编写于 作者: A Alan Cox 提交者: David S. Miller

caif: check write operations

write is optional for a tty device. Check that we have a write op rather
than calling NULL.
Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 298b9e44
......@@ -312,6 +312,10 @@ static int ldisc_open(struct tty_struct *tty)
char name[64];
int result;
/* No write no play */
if (tty->ops->write == NULL)
return -EOPNOTSUPP;
sprintf(name, "cf%s", tty->name);
dev = alloc_netdev(sizeof(*ser), name, caifdev_setup);
ser = netdev_priv(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册