team: check return value of team_get_port_by_index_rcu() for NULL
authorJiri Pirko <jiri@resnulli.us>
Sat, 8 Jun 2013 13:00:53 +0000 (15:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Jun 2013 07:56:27 +0000 (00:56 -0700)
commit76c455decbbad31de21c727edb184a963f42b40b
treef62b5479531b2eec3323f0e8b71ed475c19fc5a1
parent19a6afb23e5d323e1245baa4e62755492b2f1200
team: check return value of team_get_port_by_index_rcu() for NULL

team_get_port_by_index_rcu() might return NULL due to race between port
removal and skb tx path. Panic is easily triggeable when txing packets
and adding/removing port in a loop.

introduced by commit 3d249d4ca "net: introduce ethernet teaming device"
and commit 753f993911b "team: introduce random mode" (for random mode)

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/team/team_mode_random.c
drivers/net/team/team_mode_roundrobin.c