Commit d293dbaa authored by Dan Carpenter's avatar Dan Carpenter Committed by Alex Williamson

vfio-mdev: fix some error codes in the sample code

This is just sample code.  We forget to set the error codes in a couple
places.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reported-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 45e86971
...@@ -1449,6 +1449,7 @@ static int __init mtty_dev_init(void) ...@@ -1449,6 +1449,7 @@ static int __init mtty_dev_init(void)
if (IS_ERR(mtty_dev.vd_class)) { if (IS_ERR(mtty_dev.vd_class)) {
pr_err("Error: failed to register mtty_dev class\n"); pr_err("Error: failed to register mtty_dev class\n");
ret = PTR_ERR(mtty_dev.vd_class);
goto failed1; goto failed1;
} }
...@@ -1460,7 +1461,8 @@ static int __init mtty_dev_init(void) ...@@ -1460,7 +1461,8 @@ static int __init mtty_dev_init(void)
if (ret) if (ret)
goto failed2; goto failed2;
if (mdev_register_device(&mtty_dev.dev, &mdev_fops) != 0) ret = mdev_register_device(&mtty_dev.dev, &mdev_fops);
if (ret)
goto failed3; goto failed3;
mutex_init(&mdev_list_lock); mutex_init(&mdev_list_lock);
......
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