netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Chen <ellre923@gmail.com>
To: Dan Carpenter <error27@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [patch] missing dev_put() on error path in vif_add()
Date: Thu, 12 Nov 2009 10:50:02 +0800	[thread overview]
Message-ID: <4AFB77DA.3040600@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.0911111339100.9485@bicker>

Dan Carpenter said the following on 2009-11-11 20:03:
> The other error paths in front of this one have a dev_put() but this one 
> got missed.
> 
> Found by smatch static checker.
> 
> regards,
> dan carpenter
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> --- orig/net/ipv4/ipmr.c	2009-11-11 13:34:20.000000000 +0200
> +++ devel/net/ipv4/ipmr.c	2009-11-11 13:34:59.000000000 +0200
> @@ -483,8 +483,10 @@
>  		return -EINVAL;
>  	}
>  
> -	if ((in_dev = __in_dev_get_rtnl(dev)) == NULL)
> +	if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) {
> +		dev_put(dev);
>  		return -EADDRNOTAVAIL;
> +	}
>  	IPV4_DEVCONF(in_dev->cnf, MC_FORWARDING)++;
>  	ip_rt_multicast_event(in_dev);
>  

It's my fault. Introduced in 7dc00c82cbb0119cf4663f65bbaa2cc55f961db2.

Acked-by: Wang Chen <ellre923@gmail.com>

  reply	other threads:[~2009-11-12  2:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-11 12:03 [patch] missing dev_put() on error path in vif_add() Dan Carpenter
2009-11-12  2:50 ` Wang Chen [this message]
2009-11-14  3:57   ` David Miller

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=4AFB77DA.3040600@gmail.com \
    --to=ellre923@gmail.com \
    --cc=davem@davemloft.net \
    --cc=error27@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).