Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1525a2ad76f991eba9755f75c9b6d4d97abad25e
Commit:     1525a2ad76f991eba9755f75c9b6d4d97abad25e
Parent:     04293355ac9dbe81bd01b89ca2adb58be34c2c60
Author:     Rafael J. Wysocki <[EMAIL PROTECTED]>
AuthorDate: Sun May 6 14:50:44 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon May 7 12:12:59 2007 -0700

    swsusp: fix error paths in snapshot_open
    
    We forget to increase device_available if there's an error in 
snapshot_open(),
    so the snapshot device cannot be open at all after snapshot_open() has
    returned an error.
    
    Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Acked-by: Pavel Machek <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/power/user.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/power/user.c b/kernel/power/user.c
index 845acd8..bd1771f 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -49,12 +49,14 @@ static int snapshot_open(struct inode *inode, struct file 
*filp)
        if (!atomic_add_unless(&device_available, -1, 0))
                return -EBUSY;
 
-       if ((filp->f_flags & O_ACCMODE) == O_RDWR)
+       if ((filp->f_flags & O_ACCMODE) == O_RDWR) {
+               atomic_inc(&device_available);
                return -ENOSYS;
-
-       if(create_basic_memory_bitmaps())
+       }
+       if(create_basic_memory_bitmaps()) {
+               atomic_inc(&device_available);
                return -ENOMEM;
-
+       }
        nonseekable_open(inode, filp);
        data = &snapshot_state;
        filp->private_data = data;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to