From: Chris Wright Date: Mon, 5 May 2008 20:50:24 +0000 (-0700) Subject: dccp: return -EINVAL on invalid feature length X-Git-Tag: v2.6.26-rc2~60^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19443178fbfbf40db15c86012fc37df1a44ab857;p=linux-2.6 dccp: return -EINVAL on invalid feature length 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 Acked-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller --- diff --git a/net/dccp/feat.c b/net/dccp/feat.c index 4a4f6ce449..933a0ecf8d 100644 --- a/net/dccp/feat.c +++ b/net/dccp/feat.c @@ -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 */