Subject: Re: [Cbe-oss-dev] [patch 2/5] Add support to OProfile for profiling Cell/B.E. SPUs

From: Arnd Bergmann <[email-masked]>
Date: Wed, 20 Jun 2007 11:35:58 +0200

On Wednesday 20 June 2007, [email-masked] wrote:
> > +
> > +=A0=A0=A0=A0=A0/* Allocate arrays for collecting SPU PC samples */
> > +=A0=A0=A0=A0=A0samples =3D (u32 *) kzalloc(SPUS_PER_NODE *
> > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 =A0TRACE_ARRAY_SIZE * sizeof(u32), GFP_KERNEL);
> > +
>=20
> =A0- Unnecessary cast for kzalloc().
>=20
> =A0- Allocation failure is ignored here. But there is no error handling
> =A0 =A0in timer fuction (profile_spus), too.

Right. Bob, can you make a patch to remove the case and make sure that
we never access the sample array when the allocation has failed?

	Arnd <><