Skip to content

Commit

Permalink
s390: Fix wrong size in memcmp (netiucv)
Browse files Browse the repository at this point in the history
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 <weil@mail.berlios.de>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stefan Weil authored and David S. Miller committed Feb 2, 2011
1 parent d0ff1f5 commit 5df979d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/s390/net/netiucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5df979d

Please sign in to comment.