mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
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: Dan Carpenter <dan.carpenter@oracle.com> Reported-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
parent
45e8697144
commit
d293dbaa54
@ -1449,6 +1449,7 @@ static int __init mtty_dev_init(void)
|
||||
|
||||
if (IS_ERR(mtty_dev.vd_class)) {
|
||||
pr_err("Error: failed to register mtty_dev class\n");
|
||||
ret = PTR_ERR(mtty_dev.vd_class);
|
||||
goto failed1;
|
||||
}
|
||||
|
||||
@ -1460,7 +1461,8 @@ static int __init mtty_dev_init(void)
|
||||
if (ret)
|
||||
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;
|
||||
|
||||
mutex_init(&mdev_list_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user