diff options
author | Herbert Poetzl <herbert@13thfloor.at> | 2006-03-26 11:37:30 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 18:56:57 +0200 |
commit | 3e88c17d404c5787afd5bd1763380317f5ccbf84 (patch) | |
tree | 913f04bd00842b2b45ec2ead7ab93d16c037465b /drivers/block/loop.c | |
parent | [PATCH] Use loff_t for size in struct proc_dir_entry (diff) | |
download | linux-3e88c17d404c5787afd5bd1763380317f5ccbf84.tar.xz linux-3e88c17d404c5787afd5bd1763380317f5ccbf84.zip |
[PATCH] loop: potential kernel hang waiting for kthread
Check that kernel_thread() succeeded, so we don't wait for something which
cannot happen.
Signed-off-by: Herbert Poetzl <herbert@13thfloor.at>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r-- | drivers/block/loop.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 74bf0255e98f..9c3b94e8f03b 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -839,7 +839,9 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, set_blocksize(bdev, lo_blocksize); - kernel_thread(loop_thread, lo, CLONE_KERNEL); + error = kernel_thread(loop_thread, lo, CLONE_KERNEL); + if (error < 0) + goto out_putf; wait_for_completion(&lo->lo_done); return 0; |