Skip to content

Commit

Permalink
atm: dereference of he_dev->rbps_virt in he_init_group()
Browse files Browse the repository at this point in the history
The prefix decrement causes a very long loop if pci_pool_alloc() failed
in the first iteration. Also I swapped rbps and rbpl arguments.

Reported-by: Juha Leppanen <juha_motorsportcom@luukku.com>
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Juha Leppanen authored and David S. Miller committed Sep 28, 2009
1 parent 2f72291 commit 1b66c1e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/atm/he.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,9 +921,9 @@ he_init_group(struct he_dev *he_dev, int group)
he_dev->rbrq_phys);
i = CONFIG_RBPL_SIZE;
out_free_rbpl_virt:
while (--i)
pci_pool_free(he_dev->rbps_pool, he_dev->rbpl_virt[i].virt,
he_dev->rbps_base[i].phys);
while (i--)
pci_pool_free(he_dev->rbpl_pool, he_dev->rbpl_virt[i].virt,
he_dev->rbpl_base[i].phys);
kfree(he_dev->rbpl_virt);

out_free_rbpl_base:
Expand All @@ -933,11 +933,11 @@ he_init_group(struct he_dev *he_dev, int group)
out_destroy_rbpl_pool:
pci_pool_destroy(he_dev->rbpl_pool);

i = CONFIG_RBPL_SIZE;
i = CONFIG_RBPS_SIZE;
out_free_rbps_virt:
while (--i)
pci_pool_free(he_dev->rbpl_pool, he_dev->rbps_virt[i].virt,
he_dev->rbpl_base[i].phys);
while (i--)
pci_pool_free(he_dev->rbps_pool, he_dev->rbps_virt[i].virt,
he_dev->rbps_base[i].phys);
kfree(he_dev->rbps_virt);

out_free_rbps_base:
Expand Down

0 comments on commit 1b66c1e

Please sign in to comment.