]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.36.2/isdn-gigaset-correct-bas_gigaset-rx-buffer-handling.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / isdn-gigaset-correct-bas_gigaset-rx-buffer-handling.patch
CommitLineData
ad522180
GKH
1From f3d531b99fb30945b4a64d6e2e86e1e62605aca5 Mon Sep 17 00:00:00 2001
2From: Tilman Schmidt <tilman@imap.cc>
3Date: Thu, 30 Sep 2010 13:34:51 +0000
4Subject: isdn/gigaset: correct bas_gigaset rx buffer handling
5
6From: Tilman Schmidt <tilman@imap.cc>
7
8commit f3d531b99fb30945b4a64d6e2e86e1e62605aca5 upstream.
9
10In transparent data reception, avoid a NULL pointer dereference
11in case an skbuff cannot be allocated, remove an inappropriate
12call to the HDLC flush routine, and correct the accounting of
13received bytes for continued buffers.
14
15Signed-off-by: Tilman Schmidt <tilman@imap.cc>
16Signed-off-by: David S. Miller <davem@davemloft.net>
17Signed-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)