projects
/
profile
/
ivi
/
kernel-adaptation-intel-automotive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
298b9e4
)
caif: check write operations
author
Alan Cox
<alan@linux.intel.com>
Wed, 7 Apr 2010 23:49:31 +0000
(16:49 -0700)
committer
David S. Miller
<davem@davemloft.net>
Wed, 7 Apr 2010 23:49:31 +0000
(16:49 -0700)
write is optional for a tty device. Check that we have a write op rather
than calling NULL.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/caif/caif_serial.c
patch
|
blob
|
history
diff --git
a/drivers/net/caif/caif_serial.c
b/drivers/net/caif/caif_serial.c
index
3502f60
..
c669ec3
100644
(file)
--- a/
drivers/net/caif/caif_serial.c
+++ b/
drivers/net/caif/caif_serial.c
@@
-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);