ghes_edac: Add a null pointer check in ghes_edac_unregister
Quoted 9 lines · Sughosh Ganu
Add a null check for
ghes_pvt, before dereferencing it. The pointer could still be null in case the return path is taken before initialisingghes_pvtin the registration function.
ghes_edac_registerfunction can return a 0 without initialisingghes_pvt-- this is not taken as an error inghes_probe. A subsequent call toghes_edac_unregisterwould result inghes_pvtgetting dereferenced, resulting in a panic.
Quoted 5 lines
Signed-off-by Sughosh Ganu <[email protected]>---
drivers/edac/ghes_edac.c | 3 +++ 1 file changed, 3 insertions(+)
Applied, thanks.
So yeah, the registration of ghes_edac thing is kinda causing us headaches so I redid the reg path a bit. Mind running this branch on your setup to make sure it works as expected?
https://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git/log/?h=edac
Thx.