[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a682d5066a964efc9e280e27231213b6@AcuMS.aculab.com>
Date: Tue, 11 Dec 2018 14:22:12 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Alan Douglas' <adouglas@...ence.com>,
Wen Yang <wen.yang99@....com.cn>,
Kishon Vijay Abraham I <kishon@...com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Bjorn Helgaas <bhelgaas@...gle.com>
CC: "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"zhong.weidong@....com.cn" <zhong.weidong@....com.cn>,
Bob Copeland <me@...copeland.com>,
Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
Niklas Cassel <niklas.cassel@...s.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Cyrille Pitchen <cyrille.pitchen@...e-electrons.com>
Subject: RE: [PATCH] PCI: endpoint: functions: Use kmemdup instead of
duplicating its function
From: Alan Douglas
> Sent: 06 December 2018 12:01
> Hi,
>
> On 06 December 2018 10:21, Wen Yang wrote:
> > kmemdup has implemented the function that kmalloc() + memcpy().
> > We prefer to kmemdup rather than code opened implementation.
...
> > diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-
> test.c
> > index 3e86fa3c7da3..6e42daa2a651 100644
> > --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> > +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> > @@ -169,14 +169,12 @@ static int pci_epf_test_read(struct pci_epf_test *epf_test)
> > goto err_addr;
> > }
> >
> > - buf = kzalloc(reg->size, GFP_KERNEL);
> > + buf = kzalloc(src_addr, reg->size, GFP_KERNEL);
> Looks like a typo - kmemdup instead of kzalloc?
Which is why making butter (churning) like this is mostly pointless.
It is very easy to make silly mistakes.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists