]> git.hungrycats.org Git - linux/commit
[PATCH] loop.c doesn't fail init gracefully
authorAndrew Morton <akpm@osdl.org>
Wed, 18 Feb 2004 12:46:43 +0000 (04:46 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 18 Feb 2004 12:46:43 +0000 (04:46 -0800)
commit685eba2c0d2315728eb0d514998f7c669650afc4
tree83b4e5585e1ab54c88cc900e1dc05a18ee5e59f3
parent56b63427a7aa8acad19e0651c1489f73f3d01d8d
[PATCH] loop.c doesn't fail init gracefully

From: BlaisorBlade <blaisorblade_spam@yahoo.it>

loop_init doesn't fail gracefully for two reasons:

1) If initialization of loop driver fails, we have an call to
   devfs_add("loop") without any devfs_remove; I add that.

2) On lwn.net 2.6 kernel docs, Jonathan Corbet says: "If you are calling
   add_disk() in your driver initialization routine, you should not fail
   the initialization process after the first call."

So I make loop.c conform to this request by moving add_disk after all
memory allocations.
drivers/block/loop.c