We free "dev" then dereference it on the next line.

Signed-off-by: Dan Carpenter <[email protected]>

diff --git a/drivers/staging/ipack/bridges/tpci200.c 
b/drivers/staging/ipack/bridges/tpci200.c
index ab6ea0a..08cd851 100644
--- a/drivers/staging/ipack/bridges/tpci200.c
+++ b/drivers/staging/ipack/bridges/tpci200.c
@@ -867,8 +867,8 @@ static int tpci200_slot_unregister(struct ipack_device *dev)
                return -ERESTARTSYS;
 
        ipack_device_unregister(dev);
-       kfree(dev);
        tpci200->slots[dev->slot].dev = NULL;
+       kfree(dev);
        mutex_unlock(&tpci200->mutex);
 
        return 0;
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to