summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/isocdata.c
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2010-09-30 13:34:51 +0000
committerDavid S. Miller <davem@davemloft.net>2010-10-01 00:33:33 -0700
commitf3d531b99fb30945b4a64d6e2e86e1e62605aca5 (patch)
tree13d8bcd27aafec429be40f12a4e8f3d3ab6738da /drivers/isdn/gigaset/isocdata.c
parentc8701a08d6a4efeae45d84d0aa87172f23b14e3c (diff)
downloadtalos-op-linux-f3d531b99fb30945b4a64d6e2e86e1e62605aca5.tar.gz
talos-op-linux-f3d531b99fb30945b4a64d6e2e86e1e62605aca5.zip
isdn/gigaset: correct bas_gigaset rx buffer handling
In transparent data reception, avoid a NULL pointer dereference in case an skbuff cannot be allocated, remove an inappropriate call to the HDLC flush routine, and correct the accounting of received bytes for continued buffers. Signed-off-by: Tilman Schmidt <tilman@imap.cc> CC: stable <stable@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset/isocdata.c')
-rw-r--r--drivers/isdn/gigaset/isocdata.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c
index 2dfd346fc889..f39ccdf87a17 100644
--- a/drivers/isdn/gigaset/isocdata.c
+++ b/drivers/isdn/gigaset/isocdata.c
@@ -842,13 +842,14 @@ static inline void trans_receive(unsigned char *src, unsigned count,
if (unlikely(bcs->ignore)) {
bcs->ignore--;
- hdlc_flush(bcs);
return;
}
skb = bcs->rx_skb;
- if (skb == NULL)
+ if (skb == NULL) {
skb = gigaset_new_rx_skb(bcs);
- bcs->hw.bas->goodbytes += skb->len;
+ if (skb == NULL)
+ return;
+ }
dobytes = bcs->rx_bufsize - skb->len;
while (count > 0) {
dst = skb_put(skb, count < dobytes ? count : dobytes);
@@ -860,6 +861,7 @@ static inline void trans_receive(unsigned char *src, unsigned count,
if (dobytes == 0) {
dump_bytes(DEBUG_STREAM_DUMP,
"rcv data", skb->data, skb->len);
+ bcs->hw.bas->goodbytes += skb->len;
gigaset_skb_rcvd(bcs, skb);
skb = gigaset_new_rx_skb(bcs);
if (skb == NULL)
OpenPOWER on IntegriCloud