aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/uvesafb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/uvesafb.c')
-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 e7f69ef572dc..9db3de3a8418 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -362,7 +362,7 @@ static u8 *uvesafb_vbe_state_save(struct uvesafb_par *par)
362 362
363 state = kmalloc(par->vbe_state_size, GFP_KERNEL); 363 state = kmalloc(par->vbe_state_size, GFP_KERNEL);
364 if (!state) 364 if (!state)
365 return NULL; 365 return ERR_PTR(-ENOMEM);
366 366
367 task = uvesafb_prep(); 367 task = uvesafb_prep();
368 if (!task) { 368 if (!task) {
@@ -1172,9 +1172,17 @@ static int uvesafb_open(struct fb_info *info, int user)
1172{ 1172{
1173 struct uvesafb_par *par = info->par; 1173 struct uvesafb_par *par = info->par;
1174 int cnt = atomic_read(&par->ref_count); 1174 int cnt = atomic_read(&par->ref_count);
1175 u8 *buf = NULL;
1175 1176
1176 if (!cnt && par->vbe_state_size) 1177 if (!cnt && par->vbe_state_size) {
1177 par->vbe_state_orig = uvesafb_vbe_state_save(par); 1178 buf = uvesafb_vbe_state_save(par);
1179 if (IS_ERR(buf)) {
1180 printk(KERN_WARNING "uvesafb: save hardware state"
1181 "failed, error code is %ld!\n", PTR_ERR(buf));
1182 } else {
1183 par->vbe_state_orig = buf;
1184 }
1185 }
1178 1186
1179 atomic_inc(&par->ref_count); 1187 atomic_inc(&par->ref_count);
1180 return 0; 1188 return 0;