public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven.eckelmann@gmx.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Vasiliy Kulikov <segooon@gmail.com>,
	kernel-janitors@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@suse.de>, Andrew Lunn <andrew@lunn.ch>,
	Marek Lindner <lindner_marek@yahoo.de>,
	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>,
	Andreas Langer <an.langer@gmx.de>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: batman-adv: check kmalloc() return value
Date: Sun, 12 Sep 2010 20:43:59 +0000	[thread overview]
Message-ID: <201009122244.00861.sven.eckelmann@gmx.de> (raw)
In-Reply-To: <1284317791-4744-1-git-send-email-segooon@gmail.com>

[-- Attachment #1: Type: Text/Plain, Size: 1261 bytes --]

Vasiliy Kulikov wrote:
> kmalloc() may fail, if so drop current packet.

Thanks for your patch. The indention is right, but it adds just another bug 
(locking related).

> Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
> ---
>  Compile tested.
> 
>  drivers/staging/batman-adv/routing.c |    6 ++++--
>  drivers/staging/batman-adv/unicast.c |    8 ++++++--
>  drivers/staging/batman-adv/unicast.h |    2 +-
>  3 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/batman-adv/routing.c
> b/drivers/staging/batman-adv/routing.c index e12fd99..e545260 100644
> --- a/drivers/staging/batman-adv/routing.c
> +++ b/drivers/staging/batman-adv/routing.c
> @@ -1232,8 +1232,10 @@ 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)) {
> +			if (create_frag_buffer(&orig_node->frag_list))
> +				return NET_RX_DROP;
> +		}
> 
>  		tmp_frag_entry =
>  			search_frag_packet(&orig_node->frag_list,

You must spin_unlock_irqrestore before you return from that function.

Best regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      parent reply	other threads:[~2010-09-12 20:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-12 18:56 [PATCH] staging: batman-adv: check kmalloc() return value Vasiliy Kulikov
2010-09-12 19:57 ` Marek Lindner
2010-09-12 20:43 ` Sven Eckelmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201009122244.00861.sven.eckelmann@gmx.de \
    --to=sven.eckelmann@gmx.de \
    --cc=an.langer@gmx.de \
    --cc=andrew@lunn.ch \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lindner_marek@yahoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=segooon@gmail.com \
    --cc=siwu@hrz.tu-chemnitz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox