lkml.org 
[lkml]   [2015]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 15/31] misc/vmw_vmci: use kmemdup rather than duplicating its implementation
    From
    Date
    Ping.

    Regards
    Andrzej

    On 08/07/2015 09:59 AM, Andrzej Hajda wrote:
    > The patch was generated using fixed coccinelle semantic patch
    > scripts/coccinelle/api/memdup.cocci [1].
    >
    > [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
    >
    > Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
    > ---
    > drivers/misc/vmw_vmci/vmci_datagram.c | 3 +--
    > 1 file changed, 1 insertion(+), 2 deletions(-)
    >
    > diff --git a/drivers/misc/vmw_vmci/vmci_datagram.c b/drivers/misc/vmw_vmci/vmci_datagram.c
    > index 8226652..8a4b6bb 100644
    > --- a/drivers/misc/vmw_vmci/vmci_datagram.c
    > +++ b/drivers/misc/vmw_vmci/vmci_datagram.c
    > @@ -276,11 +276,10 @@ static int dg_dispatch_as_host(u32 context_id, struct vmci_datagram *dg)
    > }
    >
    > /* We make a copy to enqueue. */
    > - new_dg = kmalloc(dg_size, GFP_KERNEL);
    > + new_dg = kmemdup(dg, dg_size, GFP_KERNEL);
    > if (new_dg == NULL)
    > return VMCI_ERROR_NO_MEM;
    >
    > - memcpy(new_dg, dg, dg_size);
    > retval = vmci_ctx_enqueue_datagram(dg->dst.context, new_dg);
    > if (retval < VMCI_SUCCESS) {
    > kfree(new_dg);



    \
     
     \ /
      Last update: 2015-09-16 12:21    [W:4.643 / U:0.264 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site