diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2007-07-17 07:03:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:23:03 -0400 |
commit | 294462a5c6c4fb9a6ced9cb5a368ff335f1b656e (patch) | |
tree | a73c650050ec3b84b09a87d349a738113be3c093 /block/genhd.c | |
parent | 62239ac2b301abc397e70986649666cfb7835907 (diff) |
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/genhd.c')
-rw-r--r-- | block/genhd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/genhd.c b/block/genhd.c index b321cadd6e65..7f71b2c472b8 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -120,9 +120,10 @@ int unregister_blkdev(unsigned int major, const char *name) | |||
120 | for (n = &major_names[index]; *n; n = &(*n)->next) | 120 | for (n = &major_names[index]; *n; n = &(*n)->next) |
121 | if ((*n)->major == major) | 121 | if ((*n)->major == major) |
122 | break; | 122 | break; |
123 | if (!*n || strcmp((*n)->name, name)) | 123 | if (!*n || strcmp((*n)->name, name)) { |
124 | WARN_ON(1); | ||
124 | ret = -EINVAL; | 125 | ret = -EINVAL; |
125 | else { | 126 | } else { |
126 | p = *n; | 127 | p = *n; |
127 | *n = p->next; | 128 | *n = p->next; |
128 | } | 129 | } |