From patchwork Fri Sep 18 00:57:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 33812 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 25179B7B6F for ; Fri, 18 Sep 2009 10:57:37 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753887AbZIRA50 (ORCPT ); Thu, 17 Sep 2009 20:57:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753833AbZIRA5Z (ORCPT ); Thu, 17 Sep 2009 20:57:25 -0400 Received: from qmta05.westchester.pa.mail.comcast.net ([76.96.62.48]:49028 "EHLO QMTA05.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753056AbZIRA5Z (ORCPT ); Thu, 17 Sep 2009 20:57:25 -0400 Received: from OMTA02.westchester.pa.mail.comcast.net ([76.96.62.19]) by QMTA05.westchester.pa.mail.comcast.net with comcast id i0Kf1c0040QuhwU550xVR3; Fri, 18 Sep 2009 00:57:29 +0000 Received: from localhost.localdomain ([63.64.152.142]) by OMTA02.westchester.pa.mail.comcast.net with comcast id i0xA1c00A34bfcX3N0xCCu; Fri, 18 Sep 2009 00:57:27 +0000 From: Jeff Kirsher Subject: [net-2.6 PATCH 1/6] net: initialize rmem_alloc and omem_alloc to 0 in netlink socket To: davem@davemloft.net Cc: netdev@vger.kernel.org, gospo@redhat.com, linux-scsi@vger.kernel.org, John Fastabend , Jeff Kirsher Date: Thu, 17 Sep 2009 17:57:09 -0700 Message-ID: <20090918005708.25594.52575.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: John Fastabend The rmem_alloc and omem_alloc socket fields are not initialized. This sets each variable to zero when a socket is created. Note the sk_wmem_alloc is already initialized in sock_init_data. Signed-off-by: John Fastabend Signed-off-by: Jeff Kirsher --- net/netlink/af_netlink.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) -- 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 c5aab6a..4e673d2 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -423,6 +423,9 @@ static int __netlink_create(struct net *net, struct socket *sock, } init_waitqueue_head(&nlk->wait); + atomic_set(&sk->sk_rmem_alloc, 0); + atomic_set(&sk->sk_omem_alloc, 0); + sk->sk_destruct = netlink_sock_destruct; sk->sk_protocol = protocol; return 0;