Commit ee239d99 authored by Tilman Schmidt's avatar Tilman Schmidt Committed by David S. Miller

gigaset: linearize skb

The code of the Gigaset driver assumes that sk_buff-s coming
from the ISDN4Linux subsystem are always linear. Explicitly
calling skb_linearize() is cheap if they are, but much more
robust in case they ever aren't.

Impact: robustness improvement
Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3305adff
...@@ -51,6 +51,12 @@ static int writebuf_from_LL(int driverID, int channel, int ack, ...@@ -51,6 +51,12 @@ static int writebuf_from_LL(int driverID, int channel, int ack,
return -ENODEV; return -ENODEV;
} }
bcs = &cs->bcs[channel]; bcs = &cs->bcs[channel];
/* can only handle linear sk_buffs */
if (skb_linearize(skb) < 0) {
dev_err(cs->dev, "%s: skb_linearize failed\n", __func__);
return -ENOMEM;
}
len = skb->len; len = skb->len;
gig_dbg(DEBUG_LLDATA, gig_dbg(DEBUG_LLDATA,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment