drivers/atm/ambassador: kill uninit'd var warning, and fix bug
authorJeff Garzik <jeff@garzik.org>
Tue, 17 Jul 2007 06:32:21 +0000 (02:32 -0400)
committerJeff Garzik <jeff@garzik.org>
Tue, 17 Jul 2007 20:18:01 +0000 (16:18 -0400)
An uninitialized variable warning illuminated an area where indeed the
variable was being used without initialization.  Unfortunately, after
verifying all such paths were fixed, the warning still appears.  So we
follow the initialization practice of other variables in this function.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/atm/ambassador.c

index 59651abfa4f8b683bc82d33fb7077224ee3256e2..b34b3829f6a9a1fa5a37fe4df0dd607dd3e76c13 100644 (file)
@@ -1040,7 +1040,7 @@ static int amb_open (struct atm_vcc * atm_vcc)
   struct atm_qos * qos;
   struct atm_trafprm * txtp;
   struct atm_trafprm * rxtp;
-  u16 tx_rate_bits;
+  u16 tx_rate_bits = -1; // hush gcc
   u16 tx_vc_bits = -1; // hush gcc
   u16 tx_frame_bits = -1; // hush gcc
   
@@ -1096,6 +1096,8 @@ static int amb_open (struct atm_vcc * atm_vcc)
            r = round_up;
          }
          error = make_rate (pcr, r, &tx_rate_bits, NULL);
+         if (error)
+           return error;
          tx_vc_bits = TX_UBR_CAPPED;
          tx_frame_bits = TX_FRAME_CAPPED;
        }