Skip to content

Commit

Permalink
libertas: fix invalid access
Browse files Browse the repository at this point in the history
card->priv must not be accessed after lbs_remove_card() was called
as lbs_remove_card() frees card->priv via free_netdev().

For libertas_sdio this is a regression introduced by 23b149c.
The correct fix to the issue described there is simply to remove the
assignment. This flag is set at the appropriate time inside
lbs_remove_card anyway.

Reported-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>
Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Sven Neumann authored and John W. Linville committed Nov 29, 2010
1 parent 517ff43 commit 16ccdf0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion drivers/net/wireless/libertas/if_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,6 @@ static void if_sdio_remove(struct sdio_func *func)
lbs_deb_sdio("call remove card\n");
lbs_stop_card(card->priv);
lbs_remove_card(card->priv);
card->priv->surpriseremoved = 1;

flush_workqueue(card->workqueue);
destroy_workqueue(card->workqueue);
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/libertas/if_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,6 @@ static int __devexit libertas_spi_remove(struct spi_device *spi)
lbs_stop_card(priv);
lbs_remove_card(priv); /* will call free_netdev */

priv->surpriseremoved = 1;
free_irq(spi->irq, card);
if_spi_terminate_spi_thread(card);
if (card->pdata->teardown)
Expand Down

0 comments on commit 16ccdf0

Please sign in to comment.