Skip to content

Commit

Permalink
Staging: ipack: dereferencing freed memory
Browse files Browse the repository at this point in the history
We free "dev" then dereference it on the next line.

Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed May 10, 2012
1 parent 8bdeeb2 commit 3a745b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/ipack/bridges/tpci200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3a745b6

Please sign in to comment.