Skip to contentSkip to conversation

dereference of uninitialized pointer in zatm

PATCH Applied [email protected] 2 participants 2 messages Sep 2, 2005 ATM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dereference of uninitialized pointer in zatm

Fixing breakage from [NET]: Kill skb->list - original was

	assign vcc
	do a bunch of stuff using ZATM_VCC(vcc)->pool as common subexpression
Now we do
	int pos = ZATM_VCC(vcc)->pool;
	assign vcc
	do a bunch of stuff

even though vcc is not even initialized when we enter that block...

----

drivers/atm/zatm.c +2 -2
diff -urN RC13-uml-checker/drivers/atm/zatm.c RC13-zatm/drivers/atm/zatm.c
@@ -417,9 +417,9 @@
 		chan = (here[3] & uPD98401_AAL5_CHAN) >>
 		    uPD98401_AAL5_CHAN_SHIFT;
 		if (chan < zatm_dev->chans && zatm_dev->rx_map[chan]) {
-			int pos = ZATM_VCC(vcc)->pool;
-
+			int pos;
 			vcc = zatm_dev->rx_map[chan];
+			pos = ZATM_VCC(vcc)->pool;
 			if (skb == zatm_dev->last_free[pos])
 				zatm_dev->last_free[pos] = NULL;
 			skb_unlink(skb, zatm_dev->pool + pos);
#1 lore raw

From: [email protected]
Date: Fri, 2 Sep 2005 19:46:42 +0100

Quoted 10 lines

Fixing breakage from [NET]: Kill skb->list - original was

	assign vcc
	do a bunch of stuff using ZATM_VCC(vcc)->pool as common subexpression
Now we do
	int pos = ZATM_VCC(vcc)->pool;
	assign vcc
	do a bunch of stuff

even though vcc is not even initialized when we enter that block...

Applied, thanks Al.