sctp: optimize the sctp_sysctl_net_register
authorwangweidong <wangweidong1@huawei.com>
Wed, 12 Feb 2014 01:44:44 +0000 (09:44 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Feb 2014 22:08:29 +0000 (17:08 -0500)
commitefb842c45e667332774196bd5a1d539d048159cc
tree6b4d1df5479cc9b9fe7c45f65bf4ff7f3a48d06e
parent22a1f5140ed69baa5906ce9b2b9143478f5a4da0
sctp: optimize the sctp_sysctl_net_register

Here, when the net is init_net, we needn't to kmemdup the ctl_table
again. So add a check for net. Also we can save some memory.

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/sysctl.c