Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359327
b: refs/heads/master
c: b051f6e
h: refs/heads/master
i:
  359325: 68cd478
  359323: c233d33
  359319: d764400
  359311: ee26a64
  359295: 263e944
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent 0a32afe commit a0d0aa6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c718aa652d3def382a79c25442c2a830263e52ed
refs/heads/master: b051f6edc29c084a6440e9731bc85d95b6b95e14
24 changes: 6 additions & 18 deletions trunk/drivers/atm/nicstar.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,11 +949,10 @@ static void free_scq(ns_dev *card, scq_info *scq, struct atm_vcc *vcc)
static void push_rxbufs(ns_dev * card, struct sk_buff *skb)
{
struct sk_buff *handle1, *handle2;
u32 id1 = 0, id2 = 0;
int id1, id2;
u32 addr1, addr2;
u32 stat;
unsigned long flags;
int err;

/* *BARF* */
handle2 = NULL;
Expand Down Expand Up @@ -1026,23 +1025,12 @@ static void push_rxbufs(ns_dev * card, struct sk_buff *skb)
card->lbfqc += 2;
}

do {
if (!idr_pre_get(&card->idr, GFP_ATOMIC)) {
printk(KERN_ERR
"nicstar%d: no free memory for idr\n",
card->index);
goto out;
}

if (!id1)
err = idr_get_new_above(&card->idr, handle1, 0, &id1);

if (!id2 && err == 0)
err = idr_get_new_above(&card->idr, handle2, 0, &id2);

} while (err == -EAGAIN);
id1 = idr_alloc(&card->idr, handle1, 0, 0, GFP_ATOMIC);
if (id1 < 0)
goto out;

if (err)
id2 = idr_alloc(&card->idr, handle2, 0, 0, GFP_ATOMIC);
if (id2 < 0)
goto out;

spin_lock_irqsave(&card->res_lock, flags);
Expand Down

0 comments on commit a0d0aa6

Please sign in to comment.