diff options
author | sjur.brandeland@stericsson.com <sjur.brandeland@stericsson.com> | 2011-05-12 22:44:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-15 17:45:56 -0400 |
commit | c85c2951d4da1236e32f1858db418221e624aba5 (patch) | |
tree | 8f70d7ab3dbe05ea6f812f9bfb8d341425a29193 /net/caif/cfveil.c | |
parent | bee925db9a77a5736596dcf6f91d0879f5ee915b (diff) |
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/cfveil.c')
-rw-r--r-- | net/caif/cfveil.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/caif/cfveil.c b/net/caif/cfveil.c index 1a588cd818ea..3ec83fbc2887 100644 --- a/net/caif/cfveil.c +++ b/net/caif/cfveil.c | |||
@@ -82,13 +82,14 @@ static int cfvei_transmit(struct cflayer *layr, struct cfpkt *pkt) | |||
82 | int ret; | 82 | int ret; |
83 | struct cfsrvl *service = container_obj(layr); | 83 | struct cfsrvl *service = container_obj(layr); |
84 | if (!cfsrvl_ready(service, &ret)) | 84 | if (!cfsrvl_ready(service, &ret)) |
85 | return ret; | 85 | goto err; |
86 | caif_assert(layr->dn != NULL); | 86 | caif_assert(layr->dn != NULL); |
87 | caif_assert(layr->dn->transmit != NULL); | 87 | caif_assert(layr->dn->transmit != NULL); |
88 | 88 | ||
89 | if (cfpkt_add_head(pkt, &tmp, 1) < 0) { | 89 | if (cfpkt_add_head(pkt, &tmp, 1) < 0) { |
90 | pr_err("Packet is erroneous!\n"); | 90 | pr_err("Packet is erroneous!\n"); |
91 | return -EPROTO; | 91 | ret = -EPROTO; |
92 | goto err; | ||
92 | } | 93 | } |
93 | 94 | ||
94 | /* Add info-> for MUX-layer to route the packet out. */ | 95 | /* Add info-> for MUX-layer to route the packet out. */ |
@@ -97,4 +98,7 @@ static int cfvei_transmit(struct cflayer *layr, struct cfpkt *pkt) | |||
97 | info->hdr_len = 1; | 98 | info->hdr_len = 1; |
98 | info->dev_info = &service->dev_info; | 99 | info->dev_info = &service->dev_info; |
99 | return layr->dn->transmit(layr->dn, pkt); | 100 | return layr->dn->transmit(layr->dn, pkt); |
101 | err: | ||
102 | cfpkt_destroy(pkt); | ||
103 | return ret; | ||
100 | } | 104 | } |