staging: unisys: prevent faults in visornic_pause
authorTim Sell <Timothy.Sell@unisys.com>
Thu, 9 Jul 2015 17:27:44 +0000 (13:27 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Jul 2015 01:34:58 +0000 (18:34 -0700)
Prevent faults in visornic_pause, visornic_resume(), and visornic_remove()

Prior to this patch, any call to visornic_pause(), visornic_resume(), or
visornic_remove() would fault, due to dev_set_drvdata() never having been
called to stash our struct visornic_devdata * into the device's drvdata.
I.e., all calls to dev_get_drvdata() were returning NULL, meaning a fault
was soon to follow.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visornic/visornic_main.c

index fa52e0fa5cbc09588b82bf40e4fb511ea4732fb8..72253a07c255d02006bf3e1f242d5764291a3f7f 100644 (file)
@@ -1831,6 +1831,7 @@ static int visornic_probe(struct visor_device *dev)
        }
 
        devdata->netdev = netdev;
+       dev_set_drvdata(&dev->device, devdata);
        init_waitqueue_head(&devdata->rsp_queue);
        spin_lock_init(&devdata->priv_lock);
        devdata->enabled = 0; /* not yet */