mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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>
This commit is contained in:
parent
62239ac2b3
commit
294462a5c6
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue