aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorLiad Kaufman <liad.kaufman@intel.com>2015-04-16 10:21:12 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-04-20 01:53:20 -0400
commit553452e5ffc0ed13214a287549627d02d9d7fbdc (patch)
treee34260bde05b2c2a767bce6a8a647236eefde360 /drivers/net/wireless
parent8047cc0c584844817fbf3bf57cb18c1f762a7136 (diff)
iwlwifi: pcie: prevent using unmapped memory in fw monitor
In the case of a DMA mapping error on the last iteration of the loop of the allocation of memory of the FW monitor we indeed free the pages, but don't NULL out the page variable thus allowing for the possibility of setting the FW monitor variables with invalid data to use. Fixes: c2d202017da1 ("iwlwifi: pcie: add firmware monitor capabilities") Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index 2de8fbfe4edf..6debb0c9111a 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * GPL LICENSE SUMMARY 6 * GPL LICENSE SUMMARY
7 * 7 *
8 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 8 * Copyright(c) 2007 - 2015 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as 12 * it under the terms of version 2 of the GNU General Public License as
@@ -31,8 +31,8 @@
31 * 31 *
32 * BSD LICENSE 32 * BSD LICENSE
33 * 33 *
34 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 34 * Copyright(c) 2005 - 2015 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 35 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
36 * All rights reserved. 36 * All rights reserved.
37 * 37 *
38 * Redistribution and use in source and binary forms, with or without 38 * Redistribution and use in source and binary forms, with or without
@@ -104,7 +104,7 @@ static void iwl_pcie_free_fw_monitor(struct iwl_trans *trans)
104static void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans) 104static void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans)
105{ 105{
106 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); 106 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
107 struct page *page; 107 struct page *page = NULL;
108 dma_addr_t phys; 108 dma_addr_t phys;
109 u32 size; 109 u32 size;
110 u8 power; 110 u8 power;
@@ -131,6 +131,7 @@ static void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans)
131 DMA_FROM_DEVICE); 131 DMA_FROM_DEVICE);
132 if (dma_mapping_error(trans->dev, phys)) { 132 if (dma_mapping_error(trans->dev, phys)) {
133 __free_pages(page, order); 133 __free_pages(page, order);
134 page = NULL;
134 continue; 135 continue;
135 } 136 }
136 IWL_INFO(trans, 137 IWL_INFO(trans,