staging: unisys: Remove num_visornic_open array
authorNeil Horman <nhorman@redhat.com>
Tue, 21 Jul 2015 13:55:35 +0000 (09:55 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jul 2015 04:14:08 +0000 (21:14 -0700)
commit52b1660d3b3a7fc967ba9d9b641b594fa1ac33d7
treeecd450d685359310bee2569ae203c6a129689d5a
parent80a60777d7e60e59e4deb756dc0e3989fe520f84
staging: unisys: Remove num_visornic_open array

As pointed out in a recent review, the num_visornic_open array didn't do
anything useful, and it exposed a potential race in the visornic code that
could arise while taking down a net interface while reading from the
debugfs files. Fix that by removing the array entirely, and just iterating
over all the registered netdevs in a given namespace, filtering on them
having visornic ops (to identify which are ours), and having their queues
not be stopped (identifying that they are up). This should prevent any oops
conditions happening due to changing state in that array, and save us a
bunch of code too.

Signed-off-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visornic/visornic_main.c