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

Commit 772a2f9b authored by Dan Carpenter's avatar Dan Carpenter Committed by Dave Airlie
Browse files

fb: handle allocation failure in alloc_apertures()



If the kzalloc() fails we should return NULL.  All the places that call
alloc_apertures() check for this already.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarJames Simmons <jsimmons@infradead.org>
Acked-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent bbb642f9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -873,6 +873,8 @@ struct fb_info {
static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
	struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct)
			+ max_num * sizeof(struct aperture), GFP_KERNEL);
	if (!a)
		return NULL;
	a->count = max_num;
	return a;
}