summaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorJeff Garzik2007-07-17 08:32:21 +0200
committerJeff Garzik2007-07-17 22:18:01 +0200
commitb1734d2388cc45ecdec58615e35955d0d402f938 (patch)
tree22218bc7fb0428ac6566a056a7f76edf92b44cdd /drivers/atm
parent[libata] sata_mv: use pci_try_set_mwi() (diff)
downloadkernel-qcow2-linux-b1734d2388cc45ecdec58615e35955d0d402f938.tar.gz
kernel-qcow2-linux-b1734d2388cc45ecdec58615e35955d0d402f938.tar.xz
kernel-qcow2-linux-b1734d2388cc45ecdec58615e35955d0d402f938.zip
drivers/atm/ambassador: kill uninit'd var warning, and fix bug
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>
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/ambassador.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index 59651abfa4f8..b34b3829f6a9 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -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;
}