| To: | dlstevens@xxxxxxxxxx (David Stevens) |
|---|---|
| Subject: | Re: [patch 10/13] net/socket.c::sys_bind() cleanup. |
| From: | Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> |
| Date: | Thu, 25 Nov 2004 21:19:51 +1100 |
| Cc: | lcapitulino@xxxxxxxxxxxxxxxx, akpm@xxxxxxxx, davem@xxxxxxxxxxxxx, jgarzik@xxxxxxxxx, netdev@xxxxxxxxxxx |
| In-reply-to: | <OFF45FF067.1B428792-ON88256F56.0078D794-88256F56.007926F9@us.ibm.com> |
| Organization: | Core |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) |
David Stevens <dlstevens@xxxxxxxxxx> wrote: > It's just a style issue, so maybe you'll disagree, but I prefer: > > if (!sock) > return err; > > to your > > if (!sock) > goto out; > ... > out: > return err; > > I think "return err" is more readable than "goto out/return err" > for > that path and having another "return err" for the out-with-put case isn't > a > terrible thing. When used in isolation you would be right. However when there are multiple exit points then the goto is better because it means that we have only one exit path. When you have multiple exit paths it's very easy to get memory leaks and missing unlock's. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: "deadlock" between smc91x driver and link_watch, Ian Campbell |
|---|---|
| Next by Date: | Re: Fw: ipsec hang, Herbert Xu |
| Previous by Thread: | Re: [patch 10/13] net/socket.c::sys_bind() cleanup., David Stevens |
| Next by Thread: | [patch 12/13] make ibmveth link always up, akpm |
| Indexes: | [Date] [Thread] [Top] [All Lists] |