diff options
author | Vasiliy Kulikov <segooon@gmail.com> | 2010-09-12 21:21:56 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-14 23:38:34 (GMT) |
commit | ff75f96bb0e9d4fc42efb66a6ccb7bf83ecc298f (patch) | |
tree | 3c10509bd1f1a5add4f2a21f321482be7c37092b /drivers/staging/batman-adv/routing.c | |
parent | b001f71ed1ea728814175b711602e150826d13cc (diff) | |
download | linux-fsl-qoriq-ff75f96bb0e9d4fc42efb66a6ccb7bf83ecc298f.tar.xz |
Staging: batman-adv: check kmalloc() return value
kmalloc() may fail, if so drop current packet.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
[sven.eckelmann@gmx.de: Removed new introduced deadlock]
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/routing.c')
-rw-r--r-- | drivers/staging/batman-adv/routing.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/batman-adv/routing.c b/drivers/staging/batman-adv/routing.c index e12fd99..2cf8cf9 100644 --- a/drivers/staging/batman-adv/routing.c +++ b/drivers/staging/batman-adv/routing.c @@ -1232,8 +1232,12 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if) orig_node->last_frag_packet = jiffies; - if (list_empty(&orig_node->frag_list)) - create_frag_buffer(&orig_node->frag_list); + if (list_empty(&orig_node->frag_list) && + create_frag_buffer(&orig_node->frag_list)) { + spin_unlock_irqrestore(&bat_priv->orig_hash_lock, + flags); + return NET_RX_DROP; + } tmp_frag_entry = search_frag_packet(&orig_node->frag_list, |