econet: unlock on -EPERM path
Subsystems (3)
PATCH 1/1 econet: unlock on -EPERM path
We need to do a mutex_unlock() and a put_dev() before returning.
Signed-off-by Dan Carpenter <[email protected]>
net/econet/af_econet.c +4 -2
@@ -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 ) {
Quoted 1 line · Dan Carpenter
We need to do a
mutex_unlock()and aput_dev()before returning.
Good catch! Btw, isn't this put_dev() below, in case SIOCGIFADDR, superfluous?
Jarek P.
Quoted 5 lines · Jarek Poplawski
Quoted 1 line · Dan Carpenter
We need to do a
mutex_unlock()and aput_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.
David Miller
maintainerFrom: Dan Carpenter <[email protected]>
Date: Tue, 7 Dec 2010 14:01:38 +0300
Quoted 3 lines
We need to do a
mutex_unlock()and aput_dev()before returning.Signed-off-by Dan Carpenter <[email protected]>
Nelson Elhage beat you to this one, so I integrates his version.
Thanks.