]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[IPV4/6]: Fix UFO error propagation
authorPatrick McHardy <kaber@trash.net>
Mon, 13 Mar 2006 04:35:12 +0000 (20:35 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 13 Mar 2006 04:39:40 +0000 (20:39 -0800)
When ufo_append_data fails err is uninitialized, but returned back.
Strangely gcc doesn't notice it.

Coverity #901 and #902

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_output.c
net/ipv6/ip6_output.c

index 57d290d89ec2b06741105c1f5eca2e103190f69f..8ee4d016740d925f3781b8fc7842c99ed2145c27 100644 (file)
@@ -847,10 +847,11 @@ int ip_append_data(struct sock *sk,
        if (((length > mtu) && (sk->sk_protocol == IPPROTO_UDP)) &&
                        (rt->u.dst.dev->features & NETIF_F_UFO)) {
 
-               if(ip_ufo_append_data(sk, getfrag, from, length, hh_len,
-                              fragheaderlen, transhdrlen, mtu, flags))
+               err = ip_ufo_append_data(sk, getfrag, from, length, hh_len,
+                                        fragheaderlen, transhdrlen, mtu,
+                                        flags);
+               if (err)
                        goto error;
-
                return 0;
        }
 
index f999edd846a9a28744321dc0ab712885454bca29..5bf70b1442eae1f0be6497774be8ea7ceac9cbf1 100644 (file)
@@ -944,10 +944,11 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
        if (((length > mtu) && (sk->sk_protocol == IPPROTO_UDP)) &&
            (rt->u.dst.dev->features & NETIF_F_UFO)) {
 
-               if(ip6_ufo_append_data(sk, getfrag, from, length, hh_len,
-                               fragheaderlen, transhdrlen, mtu, flags))
+               err = ip6_ufo_append_data(sk, getfrag, from, length, hh_len,
+                                         fragheaderlen, transhdrlen, mtu,
+                                         flags);
+               if (err)
                        goto error;
-
                return 0;
        }