Author: marek Date: 2009-12-30 03:36:43 +0000 (Wed, 30 Dec 2009) New Revision: 1520
Modified: trunk/batman-adv-kernelland/routing.c trunk/batman-adv-kernelland/translation-table.c Log: batman-adv: fix kmalloc regressions
The previous patch kmalloc introduced some regressions that this patch tries to solve.
Signed-off-by: Marek Lindner lindner_marek@yahoo.de Acked-by: Simon Wunderlich siwu@hrz.tu-chemnitz.de
Modified: trunk/batman-adv-kernelland/routing.c =================================================================== --- trunk/batman-adv-kernelland/routing.c 2009-12-30 01:33:46 UTC (rev 1519) +++ trunk/batman-adv-kernelland/routing.c 2009-12-30 03:36:43 UTC (rev 1520) @@ -155,7 +155,7 @@ neigh_node = tmp_neigh_node; }
- if (neigh_node) + if (!neigh_node) neigh_node = create_neighbor(orig_node, orig_neigh_node, orig_neigh_node->orig, @@ -267,7 +267,7 @@ ring_buffer_avg(tmp_neigh_node->tq_recv); }
- if (neigh_node == NULL) { + if (!neigh_node) { struct orig_node *orig_tmp;
orig_tmp = get_orig_node(ethhdr->h_source);
Modified: trunk/batman-adv-kernelland/translation-table.c =================================================================== --- trunk/batman-adv-kernelland/translation-table.c 2009-12-30 01:33:46 UTC (rev 1519) +++ trunk/batman-adv-kernelland/translation-table.c 2009-12-30 03:36:43 UTC (rev 1520) @@ -337,10 +337,8 @@ orig_node->hna_buff_len = 0;
if (hna_buff_len > 0) { - unsigned char *hna_buff; - hna_buff = kmalloc(orig_node->hna_buff_len, GFP_ATOMIC); - if (hna_buff) { - orig_node->hna_buff = hna_buff; + orig_node->hna_buff = kmalloc(orig_node->hna_buff_len, GFP_ATOMIC); + if (orig_node->hna_buff) { memcpy(orig_node->hna_buff, hna_buff, orig_node->hna_buff_len); orig_node->hna_buff_len = hna_buff_len;