Skip to content

Commit

Permalink
isdn/gigaset: correct bas_gigaset rx buffer handling
Browse files Browse the repository at this point in the history
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 <[email protected]>
CC: stable <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
tilmanschmidt authored and davem330 committed Oct 1, 2010
1 parent c8701a0 commit f3d531b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/isdn/gigaset/isocdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down

0 comments on commit f3d531b

Please sign in to comment.