endpoint: fix potential deadlock
authorDaniel Mack <zonque@gmail.com>
Tue, 17 Dec 2013 12:59:56 +0000 (13:59 +0100)
committerDaniel Mack <zonque@gmail.com>
Tue, 17 Dec 2013 12:59:56 +0000 (13:59 +0100)
endpoint.c

index 07742c3b50fc9759778a17d91e7e89d201a52563..a36e014fdeee7326999e1575b60eacc2315fff64 100644 (file)
@@ -182,6 +182,7 @@ int kdbus_ep_new(struct kdbus_bus *bus, struct kdbus_ns *ns, const char *name,
        i = idr_alloc(&ns->idr, e, 1, 0, GFP_KERNEL);
        if (i <= 0) {
                ret = i;
+               mutex_unlock(&ns->lock);
                goto exit;
        }
        e->minor = i;