staging: most: return error value
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Mon, 8 Feb 2016 17:25:34 +0000 (22:55 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Feb 2016 03:40:02 +0000 (19:40 -0800)
On error we were returning retval, but retval is not having the error
value. We will get the error value using PTR_ERR.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/aim-cdev/cdev.c

index 3a2dbf1490c69a8fa7bff91dcfcf7df7fc10acc2..de4f76abfb47cd35812082140e7b4da9511df7b5 100644 (file)
@@ -470,8 +470,8 @@ static int aim_probe(struct most_interface *iface, int channel_id,
                                     NULL,
                                     "%s", name);
 
-       retval = IS_ERR(c->dev);
-       if (retval) {
+       if (IS_ERR(c->dev)) {
+               retval = PTR_ERR(c->dev);
                pr_info("failed to create new device node %s\n", name);
                goto error_create_device;
        }