Separate error handling path from normal return to avoid
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Sat, 12 Feb 2005 01:28:07 +0000 (01:28 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Sat, 12 Feb 2005 01:28:07 +0000 (01:28 +0000)
compiler warnings about unused variables.

sys/netproto/atm/ipatm/ipatm_vcm.c

index 9311f92..78c0f9d 100644 (file)
@@ -24,7 +24,7 @@
  * notice must be reproduced on all copies.
  *
  *     @(#) $FreeBSD: src/sys/netatm/ipatm/ipatm_vcm.c,v 1.4 1999/08/28 00:48:45 peter Exp $
- *     @(#) $DragonFly: src/sys/netproto/atm/ipatm/ipatm_vcm.c,v 1.5 2005/02/01 00:51:50 joerg Exp $
+ *     @(#) $DragonFly: src/sys/netproto/atm/ipatm/ipatm_vcm.c,v 1.6 2005/02/12 01:28:07 joerg Exp $
  */
 
 /*
@@ -461,12 +461,11 @@ ipatm_openpvc(pvp, sivp)
                ivp->iv_state = IPVCC_ACTIVE;
                ivp->iv_flags |= IVF_MAPOK;
        }
+       *sivp = ivp;
+       return (0);
 
 done:
-       if (err)
-               *sivp = NULL;
-       else
-               *sivp = ivp;
+       *sivp = NULL;
        return (err);
 }
 
@@ -643,12 +642,11 @@ ipatm_createsvc(ifp, daf, dst, sivp)
        ipatm_vccnt++;
        ENQUEUE(ivp, struct ipvcc, iv_elem, inp->inf_vcq);
        (void) splx(s);
+       *sivp = ivp;
+       return (0);
 
 done:
-       if (err)
-               *sivp = NULL;
-       else
-               *sivp = ivp;
+       *sivp = NULL;
        return (err);
 }