[Cocci] [v6] coccinelle: semantic code search for missing put_device()

wen.yang99 at zte.com.cn wen.yang99 at zte.com.cn
Tue Feb 19 03:14:15 CET 2019


> > I would have a hard time saying which one is more reasonable to test, 
> I suggest to reconsider the interpretation of this software situation once more.
> > since both are extremely unlikely.
> I disagree to this view because two ellipses were intentionally specified
> in published SmPL scripts.
> So some software developers found these “special use cases” important enough.
> >> In addition, we feel that we should probably accept this patch first,
> I disagree to this imagination because I would prefer to integrate a source code variant
> without a bug (which was copied from a version on 2013-05-08 by Petr Strnad).
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/coccinelle/free/pci_free_consistent.cocci?id=f7b167113753e95ae61383e234f8d10142782ace#n12
> I hope that nicer run time behaviour can become also relevant here.

Both cases are extremely unlikely.
Although we have tested these two methods in the existing kernel code,
considering the evolution of the kernel code, these special cases may occur, so we are willing to take them into account.
We plan to modify the code like this:

 id = of_find_device_by_node at p1(x)
-... when != e = id
+... when != e = (T)id
+    when != id = (T)e

Do you have any other questions?
Thanks.

Regards,
Wen


More information about the Cocci mailing list