diff options
author | David S. Miller <davem@davemloft.net> | 2011-02-15 15:18:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-15 15:18:09 -0500 |
commit | 6d90e8f45697c633f522269368297d7416fd8783 (patch) | |
tree | 69a5692be4aa906a6672b4f8dfa999f0fe669eb7 | |
parent | d11327ad6695db8117c78d70611e71102ceec2ac (diff) |
isdn: hisax: Use l2headersize() instead of dup (and buggy) func.
There was a bug in my commit c978e7bb77dfd2cd3d1f547fa4e395cfe47f02b2
("hisax: Fix unchecked alloc_skb() return.")
One of the l2->flag checks is wrong.
Even worse it turns out I'm duplicating an existing function,
so use that instead.
Reported-by: Milton Miller <miltonm@bga.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/isdn/hisax/isdnl2.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/isdn/hisax/isdnl2.c b/drivers/isdn/hisax/isdnl2.c index 98ac835281fe..cfff0c41d298 100644 --- a/drivers/isdn/hisax/isdnl2.c +++ b/drivers/isdn/hisax/isdnl2.c | |||
@@ -1243,13 +1243,6 @@ l2_st7_tout_203(struct FsmInst *fi, int event, void *arg) | |||
1243 | st->l2.rc = 0; | 1243 | st->l2.rc = 0; |
1244 | } | 1244 | } |
1245 | 1245 | ||
1246 | static int l2_hdr_space_needed(struct Layer2 *l2) | ||
1247 | { | ||
1248 | int len = test_bit(FLG_LAPD, &l2->flag) ? 2 : 1; | ||
1249 | |||
1250 | return len + (test_bit(FLG_LAPD, &l2->flag) ? 2 : 1); | ||
1251 | } | ||
1252 | |||
1253 | static void | 1246 | static void |
1254 | l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) | 1247 | l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) |
1255 | { | 1248 | { |
@@ -1268,7 +1261,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) | |||
1268 | if (!skb) | 1261 | if (!skb) |
1269 | return; | 1262 | return; |
1270 | 1263 | ||
1271 | hdr_space_needed = l2_hdr_space_needed(l2); | 1264 | hdr_space_needed = l2headersize(l2, 0); |
1272 | if (hdr_space_needed > skb_headroom(skb)) { | 1265 | if (hdr_space_needed > skb_headroom(skb)) { |
1273 | struct sk_buff *orig_skb = skb; | 1266 | struct sk_buff *orig_skb = skb; |
1274 | 1267 | ||