OSDN Git Service

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 3a2dbf1..de4f76a 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;
        }