Skip to content

Commit

Permalink
vfio-mdev: fix some error codes in the sample code
Browse files Browse the repository at this point in the history
This is just sample code.  We forget to set the error codes in a couple
places.

Signed-off-by: Dan Carpenter <[email protected]>
Reported-by: Alexey Khoroshilov <[email protected]>
Signed-off-by: Alex Williamson <[email protected]>
  • Loading branch information
Dan Carpenter authored and awilliam committed Jan 4, 2017
1 parent 45e8697 commit d293dba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion samples/vfio-mdev/mtty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
Expand Down

0 comments on commit d293dba

Please sign in to comment.