summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/genhd.c5
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)
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;
}