Skip to content

Commit

Permalink
econet: Do the correct cleanup after an unprivileged SIOCSIFADDR.
Browse files Browse the repository at this point in the history
We need to drop the mutex and do a dev_put, so set an error code and break like
the other paths, instead of returning directly.

Signed-off-by: Nelson Elhage <nelhage@ksplice.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nelson Elhage authored and David S. Miller committed Dec 8, 2010
1 parent 0833847 commit 0c62fc6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/econet/af_econet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0c62fc6

Please sign in to comment.