[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <ddb2bbd9-757b-fc62-8642-ce827a7a666d@de.ibm.com>
Date: Wed, 24 Aug 2016 11:19:28 -0400
From: Christian Borntraeger <borntraeger@...ibm.com>
To: SF Markus Elfring <elfring@...rs.sourceforge.net>,
kvm@...r.kernel.org, linux-s390@...r.kernel.org,
Cornelia Huck <cornelia.huck@...ibm.com>,
David Hildenbrand <dahi@...ux.vnet.ibm.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: Re: [PATCH 2/4] KVM-S390: Use memdup_user() rather than duplicating
its implementation
On 08/17/2016 02:08 PM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Wed, 17 Aug 2016 18:41:43 +0200
>
> * Reuse existing functionality from memdup_user() instead of keeping
> duplicate source code.
>
> This issue was detected by using the Coccinelle software.
>
> * Return directly if this copy operation failed.
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
I was going to apply this patch, but it probably makes sense to respin the
first patch first as suggested to avoid me fixing up the conflicts and then
you fixing up the new conflict.
So can you respin patch 1,2 as suggested and add the acks/rb for patch 2?
> ---
> arch/s390/kvm/guestdbg.c | 13 +++----------
> 1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/arch/s390/kvm/guestdbg.c b/arch/s390/kvm/guestdbg.c
> index b68db4b..8f886ee 100644
> --- a/arch/s390/kvm/guestdbg.c
> +++ b/arch/s390/kvm/guestdbg.c
> @@ -217,16 +217,9 @@ int kvm_s390_import_bp_data(struct kvm_vcpu *vcpu,
> return -EINVAL;
>
> size = dbg->arch.nr_hw_bp * sizeof(*bp_data);
> - bp_data = kmalloc(size, GFP_KERNEL);
> - if (!bp_data) {
> - ret = -ENOMEM;
> - goto error;
> - }
> -
> - if (copy_from_user(bp_data, dbg->arch.hw_bp, size)) {
> - ret = -EFAULT;
> - goto error;
> - }
> + bp_data = memdup_user(dbg->arch.hw_bp, size);
> + if (IS_ERR(bp_data))
> + return PTR_ERR(bp_data);
>
> for (i = 0; i < dbg->arch.nr_hw_bp; i++) {
> switch (bp_data[i].type) {
>
Powered by blists - more mailing lists