[patch 2/2] Staging: ipack: dereferencing freed memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

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
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux