summaryrefslogtreecommitdiffstats
path: root/net/caif/caif_dev.c
diff options
context:
space:
mode:
authorsjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com>2011-05-13 04:44:06 +0200
committerDavid S. Miller <davem@davemloft.net>2011-05-15 23:45:56 +0200
commitc85c2951d4da1236e32f1858db418221e624aba5 (patch)
tree8f70d7ab3dbe05ea6f812f9bfb8d341425a29193 /net/caif/caif_dev.c
parentcaif: prepare support for namespaces (diff)
downloadlinux-c85c2951d4da1236e32f1858db418221e624aba5.tar.xz
linux-c85c2951d4da1236e32f1858db418221e624aba5.zip
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 0e651cf577cf..366ca0fb7a29 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;
}
/*