diff options
author | Samuel Ortiz <samuel@sortiz.org> | 2006-09-27 23:06:44 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-28 21:02:48 -0400 |
commit | 1b0fee7d68f234be6b270cda51d9fcb71bebd780 (patch) | |
tree | 11e734d80ebaf2f0a053f912bfc59068c33ef4aa /net/irda/irlan/irlan_provider.c | |
parent | 778e6398d32590eaf2333706318cbcd04dbe50b7 (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.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c index 9c0df86044d7..58efde919667 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, | |||
296 | IRDA_ASSERT(self != NULL, return;); | 296 | IRDA_ASSERT(self != NULL, return;); |
297 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); | 297 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
298 | 298 | ||
299 | skb = alloc_skb(128, GFP_ATOMIC); | 299 | skb = alloc_skb(IRLAN_MAX_HEADER + IRLAN_CMD_HEADER + |
300 | /* Bigger param length comes from CMD_GET_MEDIA_CHAR */ | ||
301 | IRLAN_STRING_PARAMETER_LEN("FILTER_TYPE", "DIRECTED") + | ||
302 | IRLAN_STRING_PARAMETER_LEN("FILTER_TYPE", "BORADCAST") + | ||
303 | IRLAN_STRING_PARAMETER_LEN("FILTER_TYPE", "MULTICAST") + | ||
304 | IRLAN_STRING_PARAMETER_LEN("ACCESS_TYPE", "HOSTED"), | ||
305 | GFP_ATOMIC); | ||
306 | |||
300 | if (!skb) | 307 | if (!skb) |
301 | return; | 308 | return; |
302 | 309 | ||
@@ -354,8 +361,7 @@ void irlan_provider_send_reply(struct irlan_cb *self, int command, | |||
354 | } else | 361 | } else |
355 | skb->data[1] = 0x02; /* 2 parameters */ | 362 | skb->data[1] = 0x02; /* 2 parameters */ |
356 | irlan_insert_byte_param(skb, "DATA_CHAN", self->stsap_sel_data); | 363 | irlan_insert_byte_param(skb, "DATA_CHAN", self->stsap_sel_data); |
357 | irlan_insert_array_param(skb, "RECONNECT_KEY", "LINUX RULES!", | 364 | irlan_insert_string_param(skb, "RECONNECT_KEY", "LINUX RULES!"); |
358 | 12); | ||
359 | break; | 365 | break; |
360 | case CMD_FILTER_OPERATION: | 366 | case CMD_FILTER_OPERATION: |
361 | irlan_filter_request(self, skb); | 367 | irlan_filter_request(self, skb); |