mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
EDAC, ghes: Add a null pointer check in ghes_edac_unregister()
Add a null check for ghes_pvt, before dereferencing it. The pointer could still be null in case the return path is taken before initialising ghes_pvt in the registration function. Reviewed-by: Toshi Kani <[email protected]> Signed-off-by: Sughosh Ganu <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: linux-edac <[email protected]> Cc: lkml <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Borislav Petkov <[email protected]>
This commit is contained in:
parent
cc7f3f1326
commit
a66bdf5d11
1 changed files with 3 additions and 0 deletions
|
|
@ -517,6 +517,9 @@ void ghes_edac_unregister(struct ghes *ghes)
|
|||
{
|
||||
struct mem_ctl_info *mci;
|
||||
|
||||
if (!ghes_pvt)
|
||||
return;
|
||||
|
||||
mci = ghes_pvt->mci;
|
||||
edac_mc_del_mc(mci->pdev);
|
||||
edac_mc_free(mci);
|
||||
|
|
|
|||
Loading…
Reference in a new issue