aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-07-15 04:39:47 -0400
committerDave Airlie <airlied@redhat.com>2010-07-20 01:24:09 -0400
commit772a2f9b488f4d27c314da5eeabde750b9ead41b (patch)
tree2cb96edb617d659b26cad8c603d664cfa0cd1373 /include/linux
parentbbb642f9c9a43dbe45ffe14935397a2a34100263 (diff)
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: Dan Carpenter <error27@gmail.com> Acked-by: James Simmons <jsimmons@infradead.org> Acked-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 8e5a9dfb76b..e7445df44d6 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -873,6 +873,8 @@ struct fb_info {
873static inline struct apertures_struct *alloc_apertures(unsigned int max_num) { 873static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
874 struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct) 874 struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct)
875 + max_num * sizeof(struct aperture), GFP_KERNEL); 875 + max_num * sizeof(struct aperture), GFP_KERNEL);
876 if (!a)
877 return NULL;
876 a->count = max_num; 878 a->count = max_num;
877 return a; 879 return a;
878} 880}