Commit a62c4a15 authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] ppc64: crash during firmware flash update

This patch is from Linas Vepstas <linas@austin.ibm.com>.

Race conditions during system shutdown after a firmware flash can sometimes
lead to an invalid pointer deref (deref to freed memory).  This patch fixes
this.  In addition, it makes sure that the proc entries created by the
firmware flash module are removed when the module is unloaded. 
Signed-off-by: default avatarLinas Vepstas <linas@linas.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent cf1575d1
...@@ -562,6 +562,7 @@ static int validate_flash_release(struct inode *inode, struct file *file) ...@@ -562,6 +562,7 @@ static int validate_flash_release(struct inode *inode, struct file *file)
validate_flash(args_buf); validate_flash(args_buf);
} }
/* The matching atomic_inc was in rtas_excl_open() */
atomic_dec(&dp->count); atomic_dec(&dp->count);
return 0; return 0;
...@@ -572,7 +573,8 @@ static void remove_flash_pde(struct proc_dir_entry *dp) ...@@ -572,7 +573,8 @@ static void remove_flash_pde(struct proc_dir_entry *dp)
if (dp) { if (dp) {
if (dp->data != NULL) if (dp->data != NULL)
kfree(dp->data); kfree(dp->data);
remove_proc_entry(dp->name, NULL); dp->owner = NULL;
remove_proc_entry(dp->name, dp->parent);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment