Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187997
b: refs/heads/master
c: 8e59340
h: refs/heads/master
i:
  187995: 12781c5
v: v3
  • Loading branch information
Zhu Yi authored and John W. Linville committed Mar 10, 2010
1 parent 7f6ae37 commit 7817e74
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38a679a52be13d5a0c766597ab823e06688d6e8e
refs/heads/master: 8e59340e4fb65cfd748eaa1e23db057c52520f35
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ipw2x00/libipw.h
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ struct libipw_device {
/* Probe / Beacon management */
struct list_head network_free_list;
struct list_head network_list;
struct libipw_network *networks;
struct libipw_network *networks[MAX_NETWORK_COUNT];
int scans;
int scan_age;

Expand Down
37 changes: 17 additions & 20 deletions trunk/drivers/net/wireless/ipw2x00/libipw_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,17 @@ void *libipw_wiphy_privid = &libipw_wiphy_privid;

static int libipw_networks_allocate(struct libipw_device *ieee)
{
if (ieee->networks)
return 0;

ieee->networks =
kzalloc(MAX_NETWORK_COUNT * sizeof(struct libipw_network),
GFP_KERNEL);
if (!ieee->networks) {
printk(KERN_WARNING "%s: Out of memory allocating beacons\n",
ieee->dev->name);
return -ENOMEM;
int i, j;

for (i = 0; i < MAX_NETWORK_COUNT; i++) {
ieee->networks[i] = kzalloc(sizeof(struct libipw_network),
GFP_KERNEL);
if (!ieee->networks[i]) {
LIBIPW_ERROR("Out of memory allocating beacons\n");
for (j = 0; j < i; j++)
kfree(ieee->networks[j]);
return -ENOMEM;
}
}

return 0;
Expand All @@ -97,15 +98,11 @@ static inline void libipw_networks_free(struct libipw_device *ieee)
{
int i;

if (!ieee->networks)
return;

for (i = 0; i < MAX_NETWORK_COUNT; i++)
if (ieee->networks[i].ibss_dfs)
kfree(ieee->networks[i].ibss_dfs);

kfree(ieee->networks);
ieee->networks = NULL;
for (i = 0; i < MAX_NETWORK_COUNT; i++) {
if (ieee->networks[i]->ibss_dfs)
kfree(ieee->networks[i]->ibss_dfs);
kfree(ieee->networks[i]);
}
}

void libipw_networks_age(struct libipw_device *ieee,
Expand All @@ -130,7 +127,7 @@ static void libipw_networks_initialize(struct libipw_device *ieee)
INIT_LIST_HEAD(&ieee->network_free_list);
INIT_LIST_HEAD(&ieee->network_list);
for (i = 0; i < MAX_NETWORK_COUNT; i++)
list_add_tail(&ieee->networks[i].list,
list_add_tail(&ieee->networks[i]->list,
&ieee->network_free_list);
}

Expand Down

0 comments on commit 7817e74

Please sign in to comment.