lkml.org 
[lkml]   [2019]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] coccinelle: put_device: reduce false positives


    On Sat, 23 Mar 2019, Wen Yang wrote:

    > Don't complain about a return when this function returns "&pdev->dev".
    >
    > Reported-by: Julia Lawall <Julia.Lawall@lip6.fr>
    > Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
    > Cc: Julia Lawall <Julia.Lawall@lip6.fr>
    > Cc: Gilles Muller <Gilles.Muller@lip6.fr>
    > Cc: Nicolas Palix <nicolas.palix@imag.fr>
    > Cc: Michal Marek <michal.lkml@markovi.net>
    > Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
    > CC: cocci@systeme.lip6.fr
    > Cc: linux-kernel@vger.kernel.org

    Acked-by: Julia Lawall <julia.lawall@lip6.fr>


    > ---
    > scripts/coccinelle/free/put_device.cocci | 1 +
    > 1 file changed, 1 insertion(+)
    >
    > diff --git a/scripts/coccinelle/free/put_device.cocci b/scripts/coccinelle/free/put_device.cocci
    > index 7395697..c9f071b 100644
    > --- a/scripts/coccinelle/free/put_device.cocci
    > +++ b/scripts/coccinelle/free/put_device.cocci
    > @@ -32,6 +32,7 @@ if (id == NULL || ...) { ... return ...; }
    > ( id
    > | (T2)dev_get_drvdata(&id->dev)
    > | (T3)platform_get_drvdata(id)
    > +| &id->dev
    > );
    > | return@p2 ...;
    > )
    > --
    > 2.9.5
    >
    >

    \
     
     \ /
      Last update: 2019-03-23 14:42    [W:4.291 / U:0.164 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site