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]
Message-ID: <f2b94132-efd8-df81-35b3-a4990dceb05f@users.sourceforge.net>
Date:   Fri, 20 Jan 2017 19:27:54 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     kvm@...r.kernel.org, kvm-ppc@...r.kernel.org,
        linuxppc-dev@...ts.ozlabs.org, Alexander Graf <agraf@...e.com>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Radim Krčmář <rkrcmar@...hat.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 09/11] KVM: PPC: Book3S: Improve a size determination in two
 functions

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 20 Jan 2017 16:28:43 +0100

Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 arch/powerpc/kvm/book3s_xics.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c
index 3740f9efcf06..d45c1b59b70a 100644
--- a/arch/powerpc/kvm/book3s_xics.c
+++ b/arch/powerpc/kvm/book3s_xics.c
@@ -1032,7 +1032,7 @@ static struct kvmppc_ics *kvmppc_xics_create_ics(struct kvm *kvm,
 		goto out;
 
 	/* Create the ICS */
-	ics = kzalloc(sizeof(struct kvmppc_ics), GFP_KERNEL);
+	ics = kzalloc(*ics), GFP_KERNEL);
 	if (!ics)
 		goto out;
 
@@ -1064,7 +1064,7 @@ int kvmppc_xics_create_icp(struct kvm_vcpu *vcpu, unsigned long server_num)
 	if (kvmppc_xics_find_server(vcpu->kvm, server_num))
 		return -EEXIST;
 
-	icp = kzalloc(sizeof(struct kvmppc_icp), GFP_KERNEL);
+	icp = kzalloc(sizeof(*icp), GFP_KERNEL);
 	if (!icp)
 		return -ENOMEM;
 
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ