From: Stefan Weil Date: Wed, 2 Feb 2011 06:04:35 +0000 (+0000) Subject: s390: Fix wrong size in memcmp (netiucv) X-Git-Tag: upstream/snapshot3+hdmi~11431^2~71 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5df979d6922d50cc12bfbe83721c143a5d0d31b7;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git s390: Fix wrong size in memcmp (netiucv) This error was reported by cppcheck: drivers/s390/net/netiucv.c:568: error: Using sizeof for array given as function argument returns the size of pointer. sizeof(ipuser) did not result in 16 (as many programmers would have expected) but sizeof(u8 *), so it is 4 or 8, too small here. Signed-off-by: Stefan Weil Signed-off-by: Frank Blaschka Signed-off-by: David S. Miller --- diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 65ebee0..b6a6356 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -565,7 +565,7 @@ static int netiucv_callback_connreq(struct iucv_path *path, struct iucv_event ev; int rc; - if (memcmp(iucvMagic, ipuser, sizeof(ipuser))) + if (memcmp(iucvMagic, ipuser, 16)) /* ipuser must match iucvMagic. */ return -EINVAL; rc = -EINVAL;