Coverity fixes for xf86-input-evdev

Peter Hutterer peter.hutterer at who-t.net
Mon Apr 19 22:27:26 PDT 2010


On Tue, Apr 20, 2010 at 07:11:15AM +0300, Oliver McFadden wrote:
> Hi Peter,
> 
> Most of these fixes are quite minor and related to memory leaks from
> xf86...StrOption. They fix all Coverity errors in evdev apart from one dead-code
> error in EvdevUtilButtonEventToButtonNumber which I have intentionally left
> unmodified (in case that code changes in the future.)

thank you, but please rewrite some of the commit messages. 
"emuWheel: leaked_storage: EvdevWheelEmuHandleButtonMap: Variable
"option_string" goes out of scope"

that's rather stilted and aside from the line width issue a simple
"emuWheel: plug memory leak for option_string" would do. or since the
patches are quite similar anyway, you could squash the five of them into one
patch.

"evdev: check ioctl return value in EvdevProbe and print warning on
failure."
would be nicer to read, and I think the negative assignment can be written
less confusing too.

aside from that, Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
feel free to send me a pull request for them.

Cheers,
  Peter



> Event dead_error_condition: On this path, the condition "button > 32U" could not be true
> 2225 	    if (button > EVDEV_MAXBUTTONS)
> Event dead_error_line: Cannot reach dead statement "return 0U;"
> 2226 		return 0;
> 
>  src/draglock.c |    2 ++
>  src/emuWheel.c |    2 +-
>  src/evdev.c    |   20 ++++++++++++--------
>  3 files changed, 15 insertions(+), 9 deletions(-)
> 
> -- Oliver.


More information about the xorg-devel mailing list