mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
xen-blkfront: plug device number leak in xlblk_init() error path
... though after a failed xenbus_register_frontend() all may be lost. Acked-by: Ian Campbell <[email protected]> Signed-off-by: Laszlo Ersek <[email protected]> Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
This commit is contained in:
parent
d11e615830
commit
469738e675
1 changed files with 9 additions and 1 deletions
|
|
@ -1450,6 +1450,8 @@ static struct xenbus_driver blkfront = {
|
|||
|
||||
static int __init xlblk_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!xen_domain())
|
||||
return -ENODEV;
|
||||
|
||||
|
|
@ -1459,7 +1461,13 @@ static int __init xlblk_init(void)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
return xenbus_register_frontend(&blkfront);
|
||||
ret = xenbus_register_frontend(&blkfront);
|
||||
if (ret) {
|
||||
unregister_blkdev(XENVBD_MAJOR, DEV_NAME);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
module_init(xlblk_init);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue