[PATCH 1/4] void unregister_blkdev - do WARN_ON failure

From: Akinobu Mita
Date: Fri Jun 29 2007 - 23:19:31 EST


When unregister_blkdev() has failed, something wrong happened.
This patch adds WARN_ON to notify such badness.

Cc: Jens Axboe <jens.axboe@xxxxxxxxxx>
Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>

---
block/genhd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Index: 2.6-mm/block/genhd.c
===================================================================
--- 2.6-mm.orig/block/genhd.c
+++ 2.6-mm/block/genhd.c
@@ -120,9 +120,10 @@ int unregister_blkdev(unsigned int major
for (n = &major_names[index]; *n; n = &(*n)->next)
if ((*n)->major == major)
break;
- if (!*n || strcmp((*n)->name, name))
+ if (!*n || strcmp((*n)->name, name)) {
+ WARN_ON(1);
ret = -EINVAL;
- else {
+ } else {
p = *n;
*n = p->next;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/