Skip to content

Commit

Permalink
airo: reduce stack memory footprint
Browse files Browse the repository at this point in the history
Applying kernel janitors todos (reduce stack
footprint where possible) to airo wireless driver.
(Before 1124 bytes on i386, now 876)

Signed-off-by: Frank Seidel <frank@f-seidel.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Frank Seidel authored and John W. Linville committed Mar 5, 2009
1 parent b837e60 commit 998a5a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/wireless/airo.c
Original file line number Diff line number Diff line change
Expand Up @@ -7148,11 +7148,15 @@ static int airo_get_aplist(struct net_device *dev,
{
struct airo_info *local = dev->ml_priv;
struct sockaddr *address = (struct sockaddr *) extra;
struct iw_quality qual[IW_MAX_AP];
struct iw_quality *qual;
BSSListRid BSSList;
int i;
int loseSync = capable(CAP_NET_ADMIN) ? 1: -1;

qual = kmalloc(IW_MAX_AP * sizeof(*qual), GFP_KERNEL);
if (!qual)
return -ENOMEM;

for (i = 0; i < IW_MAX_AP; i++) {
u16 dBm;
if (readBSSListRid(local, loseSync, &BSSList))
Expand Down Expand Up @@ -7207,6 +7211,7 @@ static int airo_get_aplist(struct net_device *dev,
}
dwrq->length = i;

kfree(qual);
return 0;
}

Expand Down

0 comments on commit 998a5a7

Please sign in to comment.