PPC64: crash during firmware flash update
PATCH 1/1 PPC64: crash during firmware flash update
This patch is from Linas Vepstas <[email protected]>.
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 Linas Vepstas <[email protected]>
Signed-off-by Paul Mackerras <[email protected]>
arch/ppc64/kernel/rtas_flash.c +3 -1
@@ -562,6 +562,7 @@validate_flash (args_buf); } +/* The matching atomic_inc was in rtas_excl_open() */ atomic_dec (&dp->count);return 0 ;
@@ -572,7 +573,8 @@if (dp) {if (dp->data !=NULL )kfree (dp->data); -remove_proc_entry (dp->name,NULL ); + dp->owner =NULL ; +remove_proc_entry (dp->name, dp->parent); } }