netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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

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).