Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294220
b: refs/heads/master
c: c2bc0a7
h: refs/heads/master
v: v3
  • Loading branch information
Wang YanQing authored and Florian Tobias Schandinat committed Mar 8, 2012
1 parent d34c0d5 commit 85c8656
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ec0d22e4d563e7cce9f6678e2000900755c2989d
refs/heads/master: c2bc0a756b1f98bd712fabe78eb49d7d5ae72075
14 changes: 11 additions & 3 deletions trunk/drivers/video/uvesafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ static u8 *uvesafb_vbe_state_save(struct uvesafb_par *par)

state = kmalloc(par->vbe_state_size, GFP_KERNEL);
if (!state)
return NULL;
return ERR_PTR(-ENOMEM);

task = uvesafb_prep();
if (!task) {
Expand Down Expand Up @@ -1180,9 +1180,17 @@ static int uvesafb_open(struct fb_info *info, int user)
{
struct uvesafb_par *par = info->par;
int cnt = atomic_read(&par->ref_count);
u8 *buf = NULL;

if (!cnt && par->vbe_state_size)
par->vbe_state_orig = uvesafb_vbe_state_save(par);
if (!cnt && par->vbe_state_size) {
buf = uvesafb_vbe_state_save(par);
if (IS_ERR(buf)) {
printk(KERN_WARNING "uvesafb: save hardware state"
"failed, error code is %ld!\n", PTR_ERR(buf));
} else {
par->vbe_state_orig = buf;
}
}

atomic_inc(&par->ref_count);
return 0;
Expand Down

0 comments on commit 85c8656

Please sign in to comment.