Skip to content

Commit

Permalink
isdn: hisax: Use l2headersize() instead of dup (and buggy) func.
Browse files Browse the repository at this point in the history
There was a bug in my commit c978e7b
("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>
  • Loading branch information
David S. Miller committed Feb 15, 2011
1 parent d11327a commit 6d90e8f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/isdn/hisax/isdnl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1243,13 +1243,6 @@ l2_st7_tout_203(struct FsmInst *fi, int event, void *arg)
st->l2.rc = 0;
}

static int l2_hdr_space_needed(struct Layer2 *l2)
{
int len = test_bit(FLG_LAPD, &l2->flag) ? 2 : 1;

return len + (test_bit(FLG_LAPD, &l2->flag) ? 2 : 1);
}

static void
l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
{
Expand All @@ -1268,7 +1261,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
if (!skb)
return;

hdr_space_needed = l2_hdr_space_needed(l2);
hdr_space_needed = l2headersize(l2, 0);
if (hdr_space_needed > skb_headroom(skb)) {
struct sk_buff *orig_skb = skb;

Expand Down

0 comments on commit 6d90e8f

Please sign in to comment.