lkml.org 
[lkml]   [2012]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 09/12] pps: fix device destruction ordering
From
Date
device_destroy() calls final kfree(), thus cdev_del() must be called before it.
Catched as overwritten poison in kmalloc-512.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Rodolfo Giometti <giometti@enneenne.com>
---
drivers/pps/pps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index 2420d5a..769bb84 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -352,8 +352,8 @@ free_idr:

void pps_unregister_cdev(struct pps_device *pps)
{
- device_destroy(pps_class, pps->dev->devt);
cdev_del(&pps->cdev);
+ device_destroy(pps_class, pps->dev->devt);
}

/*


\
 
 \ /
  Last update: 2012-12-14 12:42    [W:0.175 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site