On Tuesday, 2018-01-16 18:35:40 +0000, Emil Velikov wrote: > On 15 January 2018 at 22:03, Grazvydas Ignotas <[email protected]> wrote: > > Found with the help of following Coccinelle semantic patch: > > // <smpl> > > @@ > > expression E; > > @@ > > > > \(pthread_mutex_lock\|mtx_lock\|simple_mtx_lock\)(E) > > ... > > ( > > \(pthread_mutex_unlock\|mtx_unlock\|simple_mtx_unlock\)(E); > > ... > > return ...; > > | > > + maybe need_unlock(E); > > return ...; > > ) > > // </smpl> > > > > Signed-off-by: Grazvydas Ignotas <[email protected]> > Grazvydas please add the stable tag, if you haven't pushed the patch. > > Thinking out loud: Should have these the Coccinelle bits in-tree. This > way we can check and address such issues quicker ;-)
Agreed; sadly I don't think it can be integrated into the build systems easily, but we could have a $mesa/bin/cocci/ folder with all our scripts, and build it with something like: $ cd $(mktemp -d) $ CC=$mesa/bin/cocci-check meson $mesa $ ninja (bonus: would work with any other build system that respects $CC) Now, someone *just* needs to write that `cocci-check` script to set up everything and run all the cocci scripts in the folder :P I'll give it a stab if/when I have some time, but I'm happy for anyone to take this up :) _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
