aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/uvesafb.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index f9a670d338d2..1f882ed6ba04 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -363,7 +363,7 @@ static u8 *uvesafb_vbe_state_save(struct uvesafb_par *par)
363 363
364 state = kmalloc(par->vbe_state_size, GFP_KERNEL); 364 state = kmalloc(par->vbe_state_size, GFP_KERNEL);
365 if (!state) 365 if (!state)
366 return NULL; 366 return ERR_PTR(-ENOMEM);
367 367
368 task = uvesafb_prep(); 368 task = uvesafb_prep();
369 if (!task) { 369 if (!task) {
@@ -1180,9 +1180,17 @@ static int uvesafb_open(struct fb_info *info, int user)
1180{ 1180{
1181 struct uvesafb_par *par = info->par; 1181 struct uvesafb_par *par = info->par;
1182 int cnt = atomic_read(&par->ref_count); 1182 int cnt = atomic_read(&par->ref_count);
1183 u8 *buf = NULL;
1183 1184
1184 if (!cnt && par->vbe_state_size) 1185 if (!cnt && par->vbe_state_size) {
1185 par->vbe_state_orig = uvesafb_vbe_state_save(par); 1186 buf = uvesafb_vbe_state_save(par);
1187 if (IS_ERR(buf)) {
1188 printk(KERN_WARNING "uvesafb: save hardware state"
1189 "failed, error code is %ld!\n", PTR_ERR(buf));
1190 } else {
1191 par->vbe_state_orig = buf;
1192 }
1193 }
1186 1194
1187 atomic_inc(&par->ref_count); 1195 atomic_inc(&par->ref_count);
1188 return 0; 1196 return 0;