summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-12 13:56:28 +0200
committerJohannes Berg <johannes.berg@intel.com>2012-07-12 14:37:39 +0200
commit3ec4588231914344834805a6828551cd5c65afd8 (patch)
treeb643426daa1081462708fee9d79a1a25ed43cca4 /drivers/net/wireless/iwlwifi
parente911ede7b7613ce231c8e10db8cb778d16013d33 (diff)
downloadop-kernel-dev-3ec4588231914344834805a6828551cd5c65afd8.zip
op-kernel-dev-3ec4588231914344834805a6828551cd5c65afd8.tar.gz
iwlwifi: don't use stack memory for kmem cache name
Since the kmem cache API doesn't internally allocate the name but just points to the name that was passed in we can't use stack memory for it. Move the name into the transport struct. Reported-by: Stanislaw Gruszka <sgruszka@redhat.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h1
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c7
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 867d8e1..92576a3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -458,6 +458,7 @@ struct iwl_trans {
/* The following fields are internal only */
struct kmem_cache *dev_cmd_pool;
size_t dev_cmd_headroom;
+ char dev_cmd_pool_name[50];
/* pointer to trans specific struct */
/*Ensure that this pointer will always be aligned to sizeof pointer */
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index 203d575..69bf615 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -2080,7 +2080,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
{
struct iwl_trans_pcie *trans_pcie;
struct iwl_trans *trans;
- char cmd_pool_name[100];
u16 pci_cmd;
int err;
@@ -2178,12 +2177,12 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
init_waitqueue_head(&trans->wait_command_queue);
spin_lock_init(&trans->reg_lock);
- snprintf(cmd_pool_name, sizeof(cmd_pool_name), "iwl_cmd_pool:%s",
- dev_name(trans->dev));
+ snprintf(trans->dev_cmd_pool_name, sizeof(trans->dev_cmd_pool_name),
+ "iwl_cmd_pool:%s", dev_name(trans->dev));
trans->dev_cmd_headroom = 0;
trans->dev_cmd_pool =
- kmem_cache_create(cmd_pool_name,
+ kmem_cache_create(trans->dev_cmd_pool_name,
sizeof(struct iwl_device_cmd)
+ trans->dev_cmd_headroom,
sizeof(void *),
OpenPOWER on IntegriCloud