aboutsummaryrefslogtreecommitdiff
path: root/net/irda/irlan/irlan_provider.c
diff options
context:
space:
mode:
authorSamuel Ortiz <samuel@sortiz.org>2006-09-27 20:06:44 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 18:02:48 -0700
commit1b0fee7d68f234be6b270cda51d9fcb71bebd780 (patch)
tree11e734d80ebaf2f0a053f912bfc59068c33ef4aa /net/irda/irlan/irlan_provider.c
parent778e6398d32590eaf2333706318cbcd04dbe50b7 (diff)
[IrDA]: Memory allocations cleanups
This patch replaces the bunch of arbitrary 64 and 128 bytes alloc_skb() calls with more accurate allocation sizes. Signed-off-by: Samuel Ortiz <samuel@sortiz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda/irlan/irlan_provider.c')
-rw-r--r--net/irda/irlan/irlan_provider.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c
index 9c0df86044d..58efde91966 100644
--- a/net/irda/irlan/irlan_provider.c
+++ b/net/irda/irlan/irlan_provider.c
@@ -296,7 +296,14 @@ void irlan_provider_send_reply(struct irlan_cb *self, int command,
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
- skb = alloc_skb(128, GFP_ATOMIC);
+ skb = alloc_skb(IRLAN_MAX_HEADER + IRLAN_CMD_HEADER +
+ /* Bigger param length comes from CMD_GET_MEDIA_CHAR */
+ IRLAN_STRING_PARAMETER_LEN("FILTER_TYPE", "DIRECTED") +
+ IRLAN_STRING_PARAMETER_LEN("FILTER_TYPE", "BORADCAST") +
+ IRLAN_STRING_PARAMETER_LEN("FILTER_TYPE", "MULTICAST") +
+ IRLAN_STRING_PARAMETER_LEN("ACCESS_TYPE", "HOSTED"),
+ GFP_ATOMIC);
+
if (!skb)
return;
@@ -354,8 +361,7 @@ void irlan_provider_send_reply(struct irlan_cb *self, int command,
} else
skb->data[1] = 0x02; /* 2 parameters */
irlan_insert_byte_param(skb, "DATA_CHAN", self->stsap_sel_data);
- irlan_insert_array_param(skb, "RECONNECT_KEY", "LINUX RULES!",
- 12);
+ irlan_insert_string_param(skb, "RECONNECT_KEY", "LINUX RULES!");
break;
case CMD_FILTER_OPERATION:
irlan_filter_request(self, skb);