[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1902160934400.3212@hadrien>
Date: Sat, 16 Feb 2019 09:36:48 +0100 (CET)
From: Julia Lawall <julia.lawall@...6.fr>
To: wen.yang99@....com.cn
cc: Markus.Elfring@....de, julia.lawall@...6.fr, Gilles.Muller@...6.fr,
nicolas.palix@...g.fr, michal.lkml@...kovi.net,
wang.yi59@....com.cn, yamada.masahiro@...ionext.com,
yellowriver2010@...mail.com, cheng.shengyu@....com.cn,
cocci@...teme.lip6.fr, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [v5] coccinelle: semantic code search for missingput_device()
On Sat, 16 Feb 2019, wen.yang99@....com.cn wrote:
> > > Thanks, We will change it to something like this:
> > > In a function, for a local variable obtained by of_find_device_by_node()
> >
> > How do you think about another wording approach?
> >
> > 1. Precondition:
> > It will be checked where the return value is stored from
> > a call of the function “of_find_device_by_node”.
> >
> > 2. The source code search will be continued with …
>
> Thanks.
> This is more rigorous, we will follow your advice
>
> > > Thank you, but a local variable is necessary.
> >
> > Would you like to take additional storage possibilities for a safer
> > analysis approach into account?
> >
> > Is the restriction “local” really sufficient when such a pointer
> > could be copied to other variables?
>
> We may be able to handle this situation:
> +id = of_find_device_by_node@p1(x)
> ...
> + when != e1 = (T)id
> + when != e1 = &id->dev
> + when != e1 = get_device(&id->dev)
This looks good. To be double sure, you can put (T)(&id->dev) in the
second case.
When you have a chance please send the revised version. As long as I
don't see that it is giving many false positives, I will accept it. We
don't need perfection. We need more to eliminate the memory leaks.
julia
>
> > > But it's over 80 characters.
> >
> > Long string literals can be accepted because of error message search concerns
> > around a tool like “grep”.
>
> Thanks.
> We will follow your advice
>
> >> Will any more advanced error diagnostics be eventually developed?
> > >
> > > Hello, we are just doing the practical work in this field.
> >
> > Are you aware of additional software design options from computer science
> > and existing analysis tools?
>
> We also use the commercial software klockwork, which will also find errors in the code,
> but a lot of false positives.
>
> Regards,
> Wen
Powered by blists - more mailing lists