From patchwork Tue Dec 7 11:01:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 74514 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5DA3FB70A3 for ; Tue, 7 Dec 2010 22:03:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755409Ab0LGLCw (ORCPT ); Tue, 7 Dec 2010 06:02:52 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:44113 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755347Ab0LGLCu (ORCPT ); Tue, 7 Dec 2010 06:02:50 -0500 Received: by wyb28 with SMTP id 28so13097532wyb.19 for ; Tue, 07 Dec 2010 03:02:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=KD4iqfdRIAemylLf/PypshojhAddLucWz3JGYwXtryw=; b=uT9rbQ6W9knTukfaON0YDVDlHtZWEPW9KfRxEzh6IVXM+yQQFj+pVwAxEhgykPSZrh u3whPwC/LLxeLPWRJvg8ER2lvaj4rRJyuwH2GhCezQbfT8nPVZgNc39bpVLZa7L3+paV mKRvS0MMguKQRKCZbobsrnNF+ljF7a+49WLMk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=tOthnNjQzIyhnLqDov0WvFzTTHTjOkF749zCs+ZRSkyYWh/1qj/yOyQQ//VCRJu+9s OYcc4VlRwHLwPD/tH/HLZEuV4GBj1ycjRRUXK8Q8pvFengxRwf548bvtGu19v5Qclx8N EQnMm0xJFyOMcQgh9hymDQ30BheoukbEi6kHs= Received: by 10.216.191.210 with SMTP id g60mr6343879wen.5.1291719769122; Tue, 07 Dec 2010 03:02:49 -0800 (PST) Received: from bicker (h14ba.n2.ips.mtn.co.ug [212.88.116.186]) by mx.google.com with ESMTPS id x59sm2862829weq.14.2010.12.07.03.02.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 07 Dec 2010 03:02:47 -0800 (PST) Date: Tue, 7 Dec 2010 14:01:38 +0300 From: Dan Carpenter To: netdev@vger.kernel.org Cc: Phil Blundell , Eric Dumazet , "David S. Miller" , kernel-janitors@vger.kernel.org Subject: [patch] econet: unlock on -EPERM path Message-ID: <20101207110138.GM10623@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We need to do a mutex_unlock() and a put_dev() before returning. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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) {