]> git.baikalelectronics.ru Git - kernel.git/commit
netprio_cgroup: fix wrong memory access when NETPRIO_CGROUP=m
authorNeil Horman <nhorman@tuxdriver.com>
Fri, 10 Feb 2012 05:43:38 +0000 (05:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Feb 2012 20:08:57 +0000 (15:08 -0500)
commitcd98ca845ef31a33a2c28d547ca9708d8bcf44e3
tree4cd1bfe8284d9266d45f5de11e3f4d8fbfcdbf4f
parent0194f977f0e9bea0d65b84c618c919cf67a4534c
netprio_cgroup: fix wrong memory access when NETPRIO_CGROUP=m

When the netprio_cgroup module is not loaded, net_prio_subsys_id
is -1, and so sock_update_prioidx() accesses cgroup_subsys array
with negative index subsys[-1].

Make the code resembles cls_cgroup code, which is bug free.

Origionally-authored-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: "David S. Miller" <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/netprio_cgroup.h
net/core/sock.c