staging: unisys: Guard against task leakage

Its possible to overwrite the old task pointer in visornic_resume.  Add a
check to guard against that and a warning if we find that its already
running

Signed-off-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Neil Horman 2015-07-21 09:55:40 -04:00 коммит произвёл Greg Kroah-Hartman
Родитель 87a9404ef0
Коммит 8cf12de41b
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -2118,8 +2118,13 @@ static int visornic_resume(struct visor_device *dev,
* we can start using the device again.
* TODO: State transitions
*/
visor_thread_start(&devdata->threadinfo, process_incoming_rsps,
devdata, "vnic_incoming");
if (!devdata->threadinfo.id)
visor_thread_start(&devdata->threadinfo,
process_incoming_rsps,
devdata, "vnic_incoming");
else
pr_warn("vnic_incoming already running!\n");
init_rcv_bufs(netdev, devdata);
spin_lock_irqsave(&devdata->priv_lock, flags);
devdata->enabled = 1;