Re: [PATCH 3/6] arch/powerpc/kvm/e500_tlb.c: fix error return code
From: Alexander Graf <hidden>
Date: 2012-10-02 11:04:17
Also in:
kernel-janitors, kvm, lkml
From: Alexander Graf <hidden>
Date: 2012-10-02 11:04:17
Also in:
kernel-janitors, kvm, lkml
On 05.08.2012, at 11:52, Julia Lawall wrote:
From: Julia Lawall <redacted> =20 Convert a 0 error return code to a negative one, as returned elsewhere =
in the
function. =20 A new label is also added to avoid freeing things that are known to =
not yet
be allocated. =20 A simplified version of the semantic match that finds the first =
problem is as
follows: (http://coccinelle.lip6.fr/) =20 // <smpl> @@ identifier ret; expression e,e1,e2,e3,e4,x; @@ =20 ( if (\(ret !=3D 0\|ret < 0\) || ...) { ... return ...; } | ret =3D 0 ) ... when !=3D ret =3D e1 *x =3D =
\(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\|ioremap\|ioremap_nocache\|devm_= ioremap\|devm_ioremap_nocache\)(...);
... when !=3D x =3D e2
when !=3D ret =3D e3
*if (x =3D=3D NULL || ...)
{
... when !=3D ret =3D e4
* return ret;
}
// </smpl>
=20
Signed-off-by: Julia Lawall <redacted>Thanks, applied to kvm-ppc-next. Alex