aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSenthil Balasubramanian <senthilkumar@atheros.com>2009-03-06 00:54:09 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-03-16 18:09:30 -0400
commitb03a9db95a285e13a5e4f2913e9d22a84bf50cc6 (patch)
tree7edbff7db9255054bf9568c1dda72dbe40270694 /drivers
parentf0e6ce13c17afd74a49e0ef043d72581562f73ae (diff)
ath9k: RX buffers may be accessed/freed even before initialized/alloced.
accessing RXBUF list in ath_rx_cleanup may cause panic if ath_descdma_setup fails even before RXBUF list is initialized. Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath9k/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 4bc43db9ab22..7d9c060704b6 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -1773,6 +1773,7 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
1773 DPRINTF(sc, ATH_DBG_CONFIG, "%s DMA: %u buffers %u desc/buf\n", 1773 DPRINTF(sc, ATH_DBG_CONFIG, "%s DMA: %u buffers %u desc/buf\n",
1774 name, nbuf, ndesc); 1774 name, nbuf, ndesc);
1775 1775
1776 INIT_LIST_HEAD(head);
1776 /* ath_desc must be a multiple of DWORDs */ 1777 /* ath_desc must be a multiple of DWORDs */
1777 if ((sizeof(struct ath_desc) % 4) != 0) { 1778 if ((sizeof(struct ath_desc) % 4) != 0) {
1778 DPRINTF(sc, ATH_DBG_FATAL, "ath_desc not DWORD aligned\n"); 1779 DPRINTF(sc, ATH_DBG_FATAL, "ath_desc not DWORD aligned\n");
@@ -1823,7 +1824,6 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
1823 } 1824 }
1824 dd->dd_bufptr = bf; 1825 dd->dd_bufptr = bf;
1825 1826
1826 INIT_LIST_HEAD(head);
1827 for (i = 0; i < nbuf; i++, bf++, ds += ndesc) { 1827 for (i = 0; i < nbuf; i++, bf++, ds += ndesc) {
1828 bf->bf_desc = ds; 1828 bf->bf_desc = ds;
1829 bf->bf_daddr = DS2PHYS(dd, ds); 1829 bf->bf_daddr = DS2PHYS(dd, ds);