From patchwork Wed Jun 15 13:11:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 100515 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 25140B6F90 for ; Wed, 15 Jun 2011 23:12:23 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754848Ab1FONMR (ORCPT ); Wed, 15 Jun 2011 09:12:17 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:61917 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754281Ab1FONMP (ORCPT ); Wed, 15 Jun 2011 09:12:15 -0400 Received: by pzk9 with SMTP id 9so214216pzk.19 for ; Wed, 15 Jun 2011 06:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=vpf4ymuk8CKFg8tjNUmK2vRjTZ4k0WY/WZhou3jNfS8=; b=aGqkA34bpnlFyO103Tkdc8LzHPTTQhxlp63wwwz1yOO5NfkrFGXewt3n0d4/Ml/iDQ lIquyi9S3+wEBrH2jiUhXTs1D5EtkuaJbnLajWlV7WWYIoJ2bz6tYkivTQJ9/5wsOPyz KEyuiy0pmFrJ29Xc4GBnyJEeRdUlXncXVfyAw= 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=boNBUKNS+mklzKzeM2k+p2e4rJ5NmRJzOTHyCrX3Au3bqJYP+B7GaHAEmIscFbNeQZ eYj+XpXffgMQpEDxYhDmHcVOyyjA9fmQmxmUiwwqFC8RnjwFAZEh3focQndw0uyoU5dR HHZ2YGQEQilrtGwLeBUreCvIOCOu4T7p63Es0= Received: by 10.68.8.105 with SMTP id q9mr217243pba.3.1308143534764; Wed, 15 Jun 2011 06:12:14 -0700 (PDT) Received: from shale.localdomain ([41.139.221.94]) by mx.google.com with ESMTPS id y2sm286505pbi.83.2011.06.15.06.12.06 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Jun 2011 06:12:14 -0700 (PDT) Date: Wed, 15 Jun 2011 16:11:42 +0300 From: Dan Carpenter To: Greg Rose Cc: Eric Dumazet , Patrick McHardy , Chris Wright , "David S. Miller" , Jeff Kirsher , "open list:NETWORKING [GENERAL]" , kernel-janitors@vger.kernel.org Subject: [patch -next] rtnetlink: unlock on error path in netlink_dump() Message-ID: <20110615131142.GE23739@shale.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In c7ac8679bec939 "rtnetlink: Compute and store minimum ifinfo dump size", we moved the allocation under the lock so we need to unlock on error path. 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/netlink/af_netlink.c b/net/netlink/af_netlink.c index 0b92f7549..ca5276c 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1676,7 +1676,7 @@ static int netlink_dump(struct sock *sk) skb = sock_rmalloc(sk, alloc_size, 0, GFP_KERNEL); if (!skb) - goto errout; + goto errout_skb; len = cb->dump(skb, cb); @@ -1716,7 +1716,6 @@ static int netlink_dump(struct sock *sk) errout_skb: mutex_unlock(nlk->cb_mutex); kfree_skb(skb); -errout: return err; }