aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2010-09-30 09:34:51 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-01 03:33:33 -0400
commitf3d531b99fb30945b4a64d6e2e86e1e62605aca5 (patch)
tree13d8bcd27aafec429be40f12a4e8f3d3ab6738da /drivers/isdn/gigaset
parentc8701a08d6a4efeae45d84d0aa87172f23b14e3c (diff)
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')
-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,
842 842
843 if (unlikely(bcs->ignore)) { 843 if (unlikely(bcs->ignore)) {
844 bcs->ignore--; 844 bcs->ignore--;
845 hdlc_flush(bcs);
846 return; 845 return;
847 } 846 }
848 skb = bcs->rx_skb; 847 skb = bcs->rx_skb;
849 if (skb == NULL) 848 if (skb == NULL) {
850 skb = gigaset_new_rx_skb(bcs); 849 skb = gigaset_new_rx_skb(bcs);
851 bcs->hw.bas->goodbytes += skb->len; 850 if (skb == NULL)
851 return;
852 }
852 dobytes = bcs->rx_bufsize - skb->len; 853 dobytes = bcs->rx_bufsize - skb->len;
853 while (count > 0) { 854 while (count > 0) {
854 dst = skb_put(skb, count < dobytes ? count : dobytes); 855 dst = skb_put(skb, count < dobytes ? count : dobytes);
@@ -860,6 +861,7 @@ static inline void trans_receive(unsigned char *src, unsigned count,
860 if (dobytes == 0) { 861 if (dobytes == 0) {
861 dump_bytes(DEBUG_STREAM_DUMP, 862 dump_bytes(DEBUG_STREAM_DUMP,
862 "rcv data", skb->data, skb->len); 863 "rcv data", skb->data, skb->len);
864 bcs->hw.bas->goodbytes += skb->len;
863 gigaset_skb_rcvd(bcs, skb); 865 gigaset_skb_rcvd(bcs, skb);
864 skb = gigaset_new_rx_skb(bcs); 866 skb = gigaset_new_rx_skb(bcs);
865 if (skb == NULL) 867 if (skb == NULL)