kdbus, endpoint: abort if device_register fails
authorDjalal Harouni <tixxdz@opendz.org>
Wed, 15 Jan 2014 17:17:08 +0000 (18:17 +0100)
committerDaniel Mack <zonque@gmail.com>
Wed, 15 Jan 2014 17:21:34 +0000 (18:21 +0100)
If device_register() fails then jump to exit to clean things up and
return.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
endpoint.c

index 5534dba38f1c6fc096fa95b1e3507f2b0daac88c..64f3c32c560ec6dddf9a36993908c514f35ecc6d 100644 (file)
@@ -206,6 +206,7 @@ int kdbus_ep_new(struct kdbus_bus *bus, struct kdbus_ns *ns, const char *name,
        if (ret < 0) {
                put_device(e->dev);
                e->dev = NULL;
+               goto exit;
        }
 
        /* install policy */