2009-02-25 14:46:42

by Frank Seidel

[permalink] [raw]
Subject: [PATCH][trivial] airo: reduce stack memory footpring

From: Frank Seidel <[email protected]>

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 <[email protected]>
---
drivers/net/wireless/airo.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -7031,11 +7031,15 @@ static int airo_get_aplist(struct net_de
{
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))
@@ -7090,6 +7094,7 @@ static int airo_get_aplist(struct net_de
}
dwrq->length = i;

+ kfree(qual);
return 0;
}



2009-02-25 14:44:58

by Frank Seidel

[permalink] [raw]
Subject: Re: [PATCH][trivial] airo: reduce stack memory footpring

Sorry, $SUBJECT should of course be:
[PATCH][trivial] airo: reduce stack memory footprint