From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: [RFC PATCH 01/14] ARM: amba device memory allocation fix Date: Wed, 18 Aug 2010 13:24:04 -0600 Message-ID: References: <1282158000-23081-1-git-send-email-lorenzo.pieralisi@arm.com> <1282158000-23081-2-git-send-email-lorenzo.pieralisi@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1282158000-23081-2-git-send-email-lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Lorenzo Pieralisi Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org, nico-vtqb6HGKxmzR7s880joybQ@public.gmane.org, catalin.marinas-5wv7dgnIgG8@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, philippe.robin-5wv7dgnIgG8@public.gmane.org, jeremy.kerr-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org List-Id: devicetree@vger.kernel.org On Wed, Aug 18, 2010 at 12:59 PM, Lorenzo Pieralisi wrote: > When instantiating amba devices dynamically from device tree nodes, the > memory allocation should be carried out using the kzalloc function to make > sure all the members are zero initialized. > > This patch replaces the kmalloc call with a kzalloc one. > > Signed-off-by: Lorenzo Pieralisi Fixed in my tree. You'll be able to drop this one when you rebase. g. > --- > =A0drivers/amba/bus.c | =A0 =A02 +- > =A01 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c > index d73302c..234f4a3 100644 > --- a/drivers/amba/bus.c > +++ b/drivers/amba/bus.c > @@ -421,7 +421,7 @@ static int amba_add_device_from_node(struct device_no= de *node) > =A0 =A0 =A0 =A0const char *name; > =A0 =A0 =A0 =A0int i, ret, len; > > - =A0 =A0 =A0 dev =3D kmalloc(sizeof(*dev), GFP_KERNEL); > + =A0 =A0 =A0 dev =3D kzalloc(sizeof(*dev), GFP_KERNEL); > =A0 =A0 =A0 =A0if (!dev) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -ENOMEM; > > -- > 1.6.3.3 > > -- = Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.