Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f97ef759 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Greg Kroah-Hartman
Browse files

drivers/misc/sgi-gru: fix possible NULL dereference



If mmu_find_ops() returns NULL then we are allocating memory for gms
using kzalloc. But kzalloc can return NULL and we were dereferencing gms
in gru_dbg().

Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6894fdae
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -317,6 +317,7 @@ struct gru_mm_struct *gru_register_mmu_notifier(void)
				goto error;
		}
	}
	if (gms)
		gru_dbg(grudev, "gms %p, refcnt %d\n", gms,
			atomic_read(&gms->ms_refcnt));
	return gms;