提交 772a2f9b 编写于 作者: D Dan Carpenter 提交者: Dave Airlie

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: NDan Carpenter <error27@gmail.com>
Acked-by: NJames Simmons <jsimmons@infradead.org>
Acked-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 bbb642f9
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册