* [patch] econet: unlock on -EPERM path
@ 2010-12-07 11:01 Dan Carpenter
2010-12-07 22:01 ` Jarek Poplawski
2010-12-08 18:14 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2010-12-07 11:01 UTC (permalink / raw)
To: netdev; +Cc: Phil Blundell, Eric Dumazet, David S. Miller, kernel-janitors
We need to do a mutex_unlock() and a put_dev() before returning.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index 13992e1..f180371 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -661,8 +661,10 @@ static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void __user *arg)
err = 0;
switch (cmd) {
case SIOCSIFADDR:
- if (!capable(CAP_NET_ADMIN))
- return -EPERM;
+ if (!capable(CAP_NET_ADMIN)) {
+ err = -EPERM;
+ break;
+ }
edev = dev->ec_ptr;
if (edev == NULL) {
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch] econet: unlock on -EPERM path
2010-12-07 11:01 [patch] econet: unlock on -EPERM path Dan Carpenter
@ 2010-12-07 22:01 ` Jarek Poplawski
2010-12-07 22:09 ` Jarek Poplawski
2010-12-08 18:14 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Jarek Poplawski @ 2010-12-07 22:01 UTC (permalink / raw)
To: Dan Carpenter
Cc: netdev, Phil Blundell, Eric Dumazet, David S. Miller,
kernel-janitors
Dan Carpenter wrote:
> We need to do a mutex_unlock() and a put_dev() before returning.
Good catch! Btw, isn't this put_dev() below, in case SIOCGIFADDR,
superfluous?
Jarek P.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] econet: unlock on -EPERM path
2010-12-07 22:01 ` Jarek Poplawski
@ 2010-12-07 22:09 ` Jarek Poplawski
0 siblings, 0 replies; 4+ messages in thread
From: Jarek Poplawski @ 2010-12-07 22:09 UTC (permalink / raw)
To: Dan Carpenter
Cc: netdev, Phil Blundell, Eric Dumazet, David S. Miller,
kernel-janitors
Jarek Poplawski wrote:
> Dan Carpenter wrote:
>> We need to do a mutex_unlock() and a put_dev() before returning.
>
> Good catch! Btw, isn't this put_dev() below, in case SIOCGIFADDR,
> superfluous?
Hmm... put_dev() a.k.a. dev_put() ;-)
Jarek P.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] econet: unlock on -EPERM path
2010-12-07 11:01 [patch] econet: unlock on -EPERM path Dan Carpenter
2010-12-07 22:01 ` Jarek Poplawski
@ 2010-12-08 18:14 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2010-12-08 18:14 UTC (permalink / raw)
To: error27; +Cc: netdev, philb, eric.dumazet, kernel-janitors
From: Dan Carpenter <error27@gmail.com>
Date: Tue, 7 Dec 2010 14:01:38 +0300
> We need to do a mutex_unlock() and a put_dev() before returning.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Nelson Elhage beat you to this one, so I integrates his version.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-08 18:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-07 11:01 [patch] econet: unlock on -EPERM path Dan Carpenter
2010-12-07 22:01 ` Jarek Poplawski
2010-12-07 22:09 ` Jarek Poplawski
2010-12-08 18:14 ` David Miller
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).