]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
Add comment, minor cleanup.
authorthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 17 Oct 2007 18:38:48 +0000 (18:38 +0000)
committerthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 17 Oct 2007 18:38:48 +0000 (18:38 +0000)
git-svn-id: svn://svn.berlios.de//socketcan/trunk@528 030b6a49-0b11-0410-94ab-b0dab22257f2

kernel/2.6/net/can/af_can.c

index b4dab440445a7e5495fa92a6b86f5d45a8efc64a..ad05b34f97bae053eba3431d00998b6069591f36 100644 (file)
@@ -213,13 +213,12 @@ static int can_create(struct socket *sock, int protocol)
 #endif
        spin_unlock(&proto_tab_lock);
 
+       /* check for success and correct type */
+       ret = -EPROTONOSUPPORT;
        if (!cp)
-               return -EPROTONOSUPPORT;
-
-       if (cp->type != sock->type) {
-               ret = -EPROTONOSUPPORT;
+               return ret;
+       if (cp->type != sock->type)
                goto errout;
-       }
 
        if (cp->capability >= 0 && !capable(cp->capability)) {
                ret = -EPERM;