From 3a745b6f471dbd7e057b30e031e476c41c6a2bf8 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 10 May 2012 18:19:04 +0300 Subject: [PATCH] Staging: ipack: dereferencing freed memory We free "dev" then dereference it on the next line. Cc: Samuel Iglesias Gonsalvez Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ipack/bridges/tpci200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ipack/bridges/tpci200.c b/drivers/staging/ipack/bridges/tpci200.c index ab6ea0a5548c..08cd85150ef2 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; -- 2.39.5