Skip to contentSkip to conversation

2.5.73: eth1394.c: ptask might be used uninitialized

PATCH Adrian Bunk 2 participants 2 messages Jun 24, 2003

lore
Share & tools
lore
#0 lore raw

In 2.5.73, gcc complains as follows:

<-- snip -->

...
CC drivers/ieee1394/eth1394.o
...
drivers/ieee1394/eth1394.c:1424: warning: `ptask' might be used uninitialized in this function
...

<-- snip -->

It seems something like the patch below might be needed (I didn't check for 100% correctness, but it shows what might be needed to fix it).

cu
Adrian

drivers/ieee1394/eth1394.c renamed from drivers/ieee1394/eth1394.c.old +2 -1
@@ -1427,7 +1427,7 @@
 	if (skb_is_nonlinear(skb)) {
 		ret = skb_linearize(skb, kmflags);
 		if(ret)
-			goto fail;
+			goto out;
 	}
 
 	ptask = kmem_cache_alloc(packet_task_cache, kmflags);
@@ -1555,6 +1555,7 @@
 		ether1394_free_packet(ptask->packet);
 	if(ptask)
 		kmem_cache_free(packet_task_cache, ptask);
+out:
 	if(skb != NULL) {
 		dev_kfree_skb(skb);
 	}
#1 lore raw

I believe this has been fixed in Linux1394 project's SVN revision 957. Hopefully, it'll be merged with the main kernel in the near future.

Quoted 48 lines · Adrian Bunk

In 2.5.73, gcc complains as follows:

<-- snip -->

...
CC drivers/ieee1394/eth1394.o
...
drivers/ieee1394/eth1394.c:1424: warning: `ptask' might be used uninitialized in this function
...

<-- snip -->

It seems something like the patch below might be needed (I didn't check for 100% correctness, but it shows what might be needed to fix it).

cu
Adrian

drivers/ieee1394/eth1394.c renamed from drivers/ieee1394/eth1394.c.old +2 -2
@@ -1427,7 +1427,7 @@
 	if (skb_is_nonlinear(skb)) {
 		ret = skb_linearize(skb, kmflags);
 		if(ret)
-			goto fail;
+			goto out;
 	}
 
 	ptask = kmem_cache_alloc(packet_task_cache, kmflags);
@@ -1555,6 +1555,7 @@
 		ether1394_free_packet(ptask->packet);
 	if(ptask)
 		kmem_cache_free(packet_task_cache, ptask);
+out:
 	if(skb != NULL) {
 		dev_kfree_skb(skb);
 	}
 
 
-------------------------------------------------------

This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux1394-devel

Signature · 6 lines
Steve Kinneberg
ACM Systems
3034 Gold Canal Drive
Rancho Cordova, CA  95670
Phone: (916) 463-7987
Email: kinnebergsteve at acmsystems dot com