diff options
author | Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> | 2012-03-11 06:28:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-11 18:38:16 -0400 |
commit | 374458b3fe4288f820dbf3de0728e314d969f9e4 (patch) | |
tree | 5249fa436617d45cd2c3e5fad60732fc6d1a0e94 /net/caif/cfsrvl.c | |
parent | e8abbe0d0236ac1d55d21fec7a8d2ee03e9d3258 (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/cfsrvl.c')
-rw-r--r-- | net/caif/cfsrvl.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/caif/cfsrvl.c b/net/caif/cfsrvl.c index b99f5b22689d..4aa33d4496b6 100644 --- a/net/caif/cfsrvl.c +++ b/net/caif/cfsrvl.c | |||
@@ -174,15 +174,11 @@ void cfsrvl_init(struct cfsrvl *service, | |||
174 | 174 | ||
175 | bool cfsrvl_ready(struct cfsrvl *service, int *err) | 175 | bool cfsrvl_ready(struct cfsrvl *service, int *err) |
176 | { | 176 | { |
177 | if (service->open && service->modem_flow_on && service->phy_flow_on) | ||
178 | return true; | ||
179 | if (!service->open) { | 177 | if (!service->open) { |
180 | *err = -ENOTCONN; | 178 | *err = -ENOTCONN; |
181 | return false; | 179 | return false; |
182 | } | 180 | } |
183 | caif_assert(!(service->modem_flow_on && service->phy_flow_on)); | 181 | return true; |
184 | *err = -EAGAIN; | ||
185 | return false; | ||
186 | } | 182 | } |
187 | 183 | ||
188 | u8 cfsrvl_getphyid(struct cflayer *layer) | 184 | u8 cfsrvl_getphyid(struct cflayer *layer) |