lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 11 Nov 2011 16:24:57 +0100
From:	Thomas Meyer <thomas@...3r.de>
To:	Alexander Graf <agraf@...e.de>
Cc:	Avi Kivity <avi@...hat.com>, kvm@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: PPC: e500: Casting (void *) value returned by
 kmalloc is useless

Am Freitag, den 11.11.2011, 15:05 +0100 schrieb Alexander Graf:
> On 11/08/2011 08:15 PM, Thomas Meyer wrote:
> > From: Thomas Meyer<thomas@...3r.de>
> >
> >   Casting (void *) value returned by kmalloc is useless
> >   as mentioned in Documentation/CodingStyle, Chap 14.
> >
> >   The semantic patch that makes this change is available
> >   in scripts/coccinelle/api/alloc/drop_kmalloc_cast.cocci.
> >
> >   More information about semantic patching is available at
> >   http://coccinelle.lip6.fr/
> >
> > Signed-off-by: Thomas Meyer<thomas@...3r.de>
> > ---
> >
> > diff -u -p a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
> > --- a/arch/powerpc/kvm/e500_tlb.c 2011-11-07 19:37:27.329638682 +0100
> > +++ b/arch/powerpc/kvm/e500_tlb.c 2011-11-08 09:18:39.955928218 +0100
> > @@ -1026,11 +1026,11 @@ int kvmppc_e500_tlb_init(struct kvmppc_v
> >   	if (vcpu_e500->gtlb_arch[1] == NULL)
> >   		goto err_out_guest0;
> >
> > -	vcpu_e500->gtlb_priv[0] = (struct tlbe_priv *)
> > +	vcpu_e500->gtlb_priv[0] =
> >   		kzalloc(sizeof(struct tlbe_priv) * KVM_E500_TLB0_SIZE, GFP_KERNEL);
> >   	if (vcpu_e500->gtlb_priv[0] == NULL)
> >   		goto err_out_guest1;
> > -	vcpu_e500->gtlb_priv[1] = (struct tlbe_priv *)
> > +	vcpu_e500->gtlb_priv[1] =
> >   		kzalloc(sizeof(struct tlbe_priv) * KVM_E500_TLB1_SIZE, GFP_KERNEL);
> 
> Sorry, I can't seem to find that code anywhere. I suppose you're using 
> an old git checkout?

No, I'm at 3.2-rc1:

https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/powerpc/kvm/e500_tlb.c#l1029

> 
> 
> Alex
> 



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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ