]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dccp: return -EINVAL on invalid feature length
authorChris Wright <chrisw@sous-sol.org>
Mon, 5 May 2008 20:50:24 +0000 (13:50 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 15 May 2008 14:50:03 +0000 (07:50 -0700)
[ Upstream commit: 19443178fbfbf40db15c86012fc37df1a44ab857 ]

dccp_feat_change() validates length and on error is returning 1.
This happens to work since call chain is checking for 0 == success,
but this is returned to userspace, so make it a real error value.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/dccp/feat.c

index 4a4f6ce4498d42c77dde9b7a5867575210931b31..933a0ecf8d463b0649fd69f78335533d86950517 100644 (file)
@@ -32,7 +32,7 @@ int dccp_feat_change(struct dccp_minisock *dmsk, u8 type, u8 feature,
 
        if (len > 3) {
                DCCP_WARN("invalid length %d\n", len);
-               return 1;
+               return -EINVAL;
        }
        /* XXX add further sanity checks */