Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194603
b: refs/heads/master
c: d3f744e
h: refs/heads/master
i:
  194601: 87a793a
  194599: 5e60196
v: v3
  • Loading branch information
Sjur Braendeland authored and David S. Miller committed Apr 28, 2010
1 parent 08778e1 commit 28525a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a4900ac9f7d10ad062e54dd03125e3619e0ac17a
refs/heads/master: d3f744e0d6c1c27a10cdceac6eb946122188dbc9
5 changes: 4 additions & 1 deletion trunk/drivers/net/caif/caif_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ static void ldisc_receive(struct tty_struct *tty, const u8 *data,

/* Get a suitable caif packet and copy in data. */
skb = netdev_alloc_skb(ser->dev, count+1);
BUG_ON(skb == NULL);
if (skb == NULL)
return;
p = skb_put(skb, count);
memcpy(p, data, count);

Expand Down Expand Up @@ -315,6 +316,8 @@ static int ldisc_open(struct tty_struct *tty)
/* No write no play */
if (tty->ops->write == NULL)
return -EOPNOTSUPP;
if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_TTY_CONFIG))
return -EPERM;

sprintf(name, "cf%s", tty->name);
dev = alloc_netdev(sizeof(*ser), name, caifdev_setup);
Expand Down

0 comments on commit 28525a4

Please sign in to comment.