Messages in this thread |  | | From | Herbert Xu <> | | Subject | Re: IPv6 oops on ifup in latest BK | | Date | Tue, 24 Aug 2004 17:33:54 +1000 |
| |
David S. Miller <davem@redhat.com> wrote: > > Maybe new code should be something like: > > if (dev && dev != &loopback_dev) {
You want if (dev) { here.
> dev_put(dev); > in6_dev_put(idev); > } > dev = &loopback_dev; > dev_hold(dev); > idev = in6_dev_get(dev); > if (!idev) { > err = -ENODEV; > goto out; > } > > What do you think?
Yes this would work. But I think Yoshifuji-san is trying to avoid the unnecessary put/get in the case where dev is already loopback_dev. So something like this might work:
if (dev != &loopback_dev) { if (dev) { dev_put(dev); in6_dev_put(idev); } ... } -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |