aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-11-24 06:27:26 -0500
committerAlex Williamson <alex.williamson@redhat.com>2017-01-04 10:32:23 -0500
commitd293dbaa540b5800817cc10832d764b17cc211b5 (patch)
tree7a8e8bbc1c2d08ecdb8b0250ababae57949c5302
parent45e869714489431625c569d21fc952428d761476 (diff)
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>
-rw-r--r--samples/vfio-mdev/mtty.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c
index 919c10d5b12e..1fc57a5093a7 100644
--- a/samples/vfio-mdev/mtty.c
+++ b/samples/vfio-mdev/mtty.c
@@ -1449,6 +1449,7 @@ static int __init mtty_dev_init(void)
1449 1449
1450 if (IS_ERR(mtty_dev.vd_class)) { 1450 if (IS_ERR(mtty_dev.vd_class)) {
1451 pr_err("Error: failed to register mtty_dev class\n"); 1451 pr_err("Error: failed to register mtty_dev class\n");
1452 ret = PTR_ERR(mtty_dev.vd_class);
1452 goto failed1; 1453 goto failed1;
1453 } 1454 }
1454 1455
@@ -1460,7 +1461,8 @@ static int __init mtty_dev_init(void)
1460 if (ret) 1461 if (ret)
1461 goto failed2; 1462 goto failed2;
1462 1463
1463 if (mdev_register_device(&mtty_dev.dev, &mdev_fops) != 0) 1464 ret = mdev_register_device(&mtty_dev.dev, &mdev_fops);
1465 if (ret)
1464 goto failed3; 1466 goto failed3;
1465 1467
1466 mutex_init(&mdev_list_lock); 1468 mutex_init(&mdev_list_lock);