From: Frank Seidel Date: Wed, 25 Feb 2009 14:39:57 +0000 (+0100) Subject: airo: reduce stack memory footprint X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=998a5a7d6aabe7e450759e0d82c8a79afd5a97ff;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git airo: reduce stack memory footprint 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 Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index a3e324e0ca83..f5e2dca083cb 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c @@ -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)) @@ -7207,6 +7211,7 @@ static int airo_get_aplist(struct net_device *dev, } dwrq->length = i; + kfree(qual); return 0; }