aboutsummaryrefslogtreecommitdiffstats
path: root/net/caif/cfutill.c
diff options
context:
space:
mode:
authorDmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>2012-03-11 06:28:31 -0400
committerDavid S. Miller <davem@davemloft.net>2012-03-11 18:38:16 -0400
commit374458b3fe4288f820dbf3de0728e314d969f9e4 (patch)
tree5249fa436617d45cd2c3e5fad60732fc6d1a0e94 /net/caif/cfutill.c
parente8abbe0d0236ac1d55d21fec7a8d2ee03e9d3258 (diff)
caif: Fix for a race in socket transmit with flow control.
Kill faulty checks on flow-off leading to connection drop at race conditions. caif_socket checks for flow-on before transmitting and goes to sleep or return -EAGAIN upon flow stop. Remove faulty subsequent checks on flow-off leading to connection drop. Also fix memory leaks on some of the errors paths. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif/cfutill.c')
-rw-r--r--net/caif/cfutill.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/caif/cfutill.c b/net/caif/cfutill.c
index 53e49f3e3af3..86d2dadb4b73 100644
--- a/net/caif/cfutill.c
+++ b/net/caif/cfutill.c
@@ -84,8 +84,11 @@ static int cfutill_transmit(struct cflayer *layr, struct cfpkt *pkt)
84 caif_assert(layr != NULL); 84 caif_assert(layr != NULL);
85 caif_assert(layr->dn != NULL); 85 caif_assert(layr->dn != NULL);
86 caif_assert(layr->dn->transmit != NULL); 86 caif_assert(layr->dn->transmit != NULL);
87 if (!cfsrvl_ready(service, &ret)) 87
88 if (!cfsrvl_ready(service, &ret)) {
89 cfpkt_destroy(pkt);
88 return ret; 90 return ret;
91 }
89 92
90 cfpkt_add_head(pkt, &zero, 1); 93 cfpkt_add_head(pkt, &zero, 1);
91 /* Add info for MUX-layer to route the packet out. */ 94 /* Add info for MUX-layer to route the packet out. */