summaryrefslogtreecommitdiffstats
path: root/net/caif/caif_dev.c
diff options
context:
space:
mode:
authorsjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com>2011-05-13 02:44:06 +0000
committerDavid S. Miller <davem@davemloft.net>2011-05-15 17:45:56 -0400
commitc85c2951d4da1236e32f1858db418221e624aba5 (patch)
tree8f70d7ab3dbe05ea6f812f9bfb8d341425a29193 /net/caif/caif_dev.c
parentbee925db9a77a5736596dcf6f91d0879f5ee915b (diff)
downloadop-kernel-dev-c85c2951d4da1236e32f1858db418221e624aba5.zip
op-kernel-dev-c85c2951d4da1236e32f1858db418221e624aba5.tar.gz
caif: Handle dev_queue_xmit errors.
Do proper handling of dev_queue_xmit errors in order to avoid double free of skb and leaks in error conditions. In cfctrl pending requests are removed when CAIF Link layer goes down. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif/caif_dev.c')
-rw-r--r--net/caif/caif_dev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
index 0e651cf..366ca0f 100644
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -118,6 +118,7 @@ static struct caif_device_entry *caif_get(struct net_device *dev)
static int transmit(struct cflayer *layer, struct cfpkt *pkt)
{
+ int err;
struct caif_device_entry *caifd =
container_of(layer, struct caif_device_entry, layer);
struct sk_buff *skb;
@@ -125,9 +126,11 @@ static int transmit(struct cflayer *layer, struct cfpkt *pkt)
skb = cfpkt_tonative(pkt);
skb->dev = caifd->netdev;
- dev_queue_xmit(skb);
+ err = dev_queue_xmit(skb);
+ if (err > 0)
+ err = -EIO;
- return 0;
+ return err;
}
/*
OpenPOWER on IntegriCloud