delete_procfs_entries: fix possible crash if top entry has no children
Change-Id: I209842699615f9bb58c12ccd262ae4b17f8f558c
This commit is contained in:
committed by
Masamichi Takagi
parent
442045a320
commit
3cc98883f5
@@ -126,7 +126,7 @@ find_procfs_entry(struct procfs_list_entry *parent, const char *name)
|
|||||||
static void
|
static void
|
||||||
delete_procfs_entries(struct procfs_list_entry *top)
|
delete_procfs_entries(struct procfs_list_entry *top)
|
||||||
{
|
{
|
||||||
struct procfs_list_entry *e;
|
struct procfs_list_entry *e = NULL;
|
||||||
struct procfs_list_entry *n;
|
struct procfs_list_entry *n;
|
||||||
|
|
||||||
list_del(&top->list);
|
list_del(&top->list);
|
||||||
@@ -136,8 +136,10 @@ delete_procfs_entries(struct procfs_list_entry *top)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
|
||||||
e->entry->read_proc = NULL;
|
if (e) {
|
||||||
e->entry->data = NULL;
|
e->entry->read_proc = NULL;
|
||||||
|
e->entry->data = NULL;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
remove_proc_entry(top->name, top->parent? top->parent->entry: NULL);
|
remove_proc_entry(top->name, top->parent? top->parent->entry: NULL);
|
||||||
if(top->data)
|
if(top->data)
|
||||||
|
|||||||
Reference in New Issue
Block a user