Commit 294462a5 authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds

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: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 62239ac2
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment