summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2007-07-17 04:03:45 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-17 10:23:03 -0700
commit294462a5c6c4fb9a6ced9cb5a368ff335f1b656e (patch)
treea73c650050ec3b84b09a87d349a738113be3c093 /block
parent62239ac2b301abc397e70986649666cfb7835907 (diff)
downloadop-kernel-dev-294462a5c6c4fb9a6ced9cb5a368ff335f1b656e.zip
op-kernel-dev-294462a5c6c4fb9a6ced9cb5a368ff335f1b656e.tar.gz
unregister_blkdev(): do WARN_ON on failure
When unregister_blkdev() has failed, something wrong happened. This patch adds WARN_ON to notify of such badness. Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'block')
-rw-r--r--block/genhd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/genhd.c b/block/genhd.c
index b321cad..7f71b2c4 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -120,9 +120,10 @@ int unregister_blkdev(unsigned int major, const char *name)
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;
}
OpenPOWER on IntegriCloud