]>
Commit | Line | Data |
---|---|---|
ad522180 GKH |
1 | From f3d531b99fb30945b4a64d6e2e86e1e62605aca5 Mon Sep 17 00:00:00 2001 |
2 | From: Tilman Schmidt <tilman@imap.cc> | |
3 | Date: Thu, 30 Sep 2010 13:34:51 +0000 | |
4 | Subject: isdn/gigaset: correct bas_gigaset rx buffer handling | |
5 | ||
6 | From: Tilman Schmidt <tilman@imap.cc> | |
7 | ||
8 | commit f3d531b99fb30945b4a64d6e2e86e1e62605aca5 upstream. | |
9 | ||
10 | In transparent data reception, avoid a NULL pointer dereference | |
11 | in case an skbuff cannot be allocated, remove an inappropriate | |
12 | call to the HDLC flush routine, and correct the accounting of | |
13 | received bytes for continued buffers. | |
14 | ||
15 | Signed-off-by: Tilman Schmidt <tilman@imap.cc> | |
16 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
17 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
18 | ||
19 | --- | |
20 | drivers/isdn/gigaset/isocdata.c | 8 +++++--- | |
21 | 1 file changed, 5 insertions(+), 3 deletions(-) | |
22 | ||
23 | --- a/drivers/isdn/gigaset/isocdata.c | |
24 | +++ b/drivers/isdn/gigaset/isocdata.c | |
25 | @@ -842,13 +842,14 @@ static inline void trans_receive(unsigne | |
26 | ||
27 | if (unlikely(bcs->ignore)) { | |
28 | bcs->ignore--; | |
29 | - hdlc_flush(bcs); | |
30 | return; | |
31 | } | |
32 | skb = bcs->rx_skb; | |
33 | - if (skb == NULL) | |
34 | + if (skb == NULL) { | |
35 | skb = gigaset_new_rx_skb(bcs); | |
36 | - bcs->hw.bas->goodbytes += skb->len; | |
37 | + if (skb == NULL) | |
38 | + return; | |
39 | + } | |
40 | dobytes = bcs->rx_bufsize - skb->len; | |
41 | while (count > 0) { | |
42 | dst = skb_put(skb, count < dobytes ? count : dobytes); | |
43 | @@ -860,6 +861,7 @@ static inline void trans_receive(unsigne | |
44 | if (dobytes == 0) { | |
45 | dump_bytes(DEBUG_STREAM_DUMP, | |
46 | "rcv data", skb->data, skb->len); | |
47 | + bcs->hw.bas->goodbytes += skb->len; | |
48 | gigaset_skb_rcvd(bcs, skb); | |
49 | skb = gigaset_new_rx_skb(bcs); | |
50 | if (skb == NULL) |