[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <878u7853g7.fsf@gamma.ozlabs.ibm.com>
Date: Mon, 12 Oct 2015 11:35:20 +1100
From: Daniel Axtens <dja@...ens.net>
To: Colin King <colin.king@...onical.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
linuxppc-dev@...ts.ozlabs.org
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] powerpc/pseries/hvcserver: don't memset pi_buff if it is null
Hi Colin,
This looks good. Out of curiousity, how did you find it? Code
inspection? Bug? Static analysis?
Not that it's particularly meaningful for such a trivial fix, but FWIW:
Reviewed-by: Daniel Axtens <dja@...ens.net>
Regards,
Daniel
Colin King <colin.king@...onical.com> writes:
> From: Colin Ian King <colin.king@...onical.com>
>
> pi_buff is being memset before it is sanity checked. Move the
> memset after the null pi_buff sanity check to avoid an oops.
>
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
> arch/powerpc/platforms/pseries/hvcserver.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/pseries/hvcserver.c b/arch/powerpc/platforms/pseries/hvcserver.c
> index eedb645..94a6e56 100644
> --- a/arch/powerpc/platforms/pseries/hvcserver.c
> +++ b/arch/powerpc/platforms/pseries/hvcserver.c
> @@ -142,11 +142,11 @@ int hvcs_get_partner_info(uint32_t unit_address, struct list_head *head,
> int more = 1;
> int retval;
>
> - memset(pi_buff, 0x00, PAGE_SIZE);
> /* invalid parameters */
> if (!head || !pi_buff)
> return -EINVAL;
>
> + memset(pi_buff, 0x00, PAGE_SIZE);
> last_p_partition_ID = last_p_unit_address = ~0UL;
> INIT_LIST_HEAD(head);
>
> --
> 2.5.0
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@...ts.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
Download attachment "signature.asc" of type "application/pgp-signature" (860 bytes)
Powered by blists - more mailing lists