Re: [PATCH 1/2] s390: Fix wrong size in memcmp (netiucv)

From: Ursula Braun
Date: Mon Jan 31 2011 - 05:37:39 EST


Ack - thanks, Stefan.

We have added your netiucv patch to our local repository. It will be
part of our next patch collection submitted to Dave Miller for upstream
integration.

Regards, Ursula

On Sat, 2011-01-29 at 22:33 +0100, Stefan Weil wrote:
> 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.
>
> Cc: Ursula Braun <ursula.braun@xxxxxxxxxx>
> Cc: linux390@xxxxxxxxxx
> Cc: Frank Blaschka <blaschka@xxxxxxxxxxxxxxxxxx>
> Cc: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
> Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
> Cc: linux-s390@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Signed-off-by: Stefan Weil <weil@xxxxxxxxxxxxxxx>
> ---
> drivers/s390/net/netiucv.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> 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;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/