linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH wpan-tools 0/4] Coverity fixes for wpan-ping
@ 2015-11-10 21:42 Stefan Schmidt
  2015-11-10 21:42 ` [PATCH wpan-tools 1/4] wpan-ping: remove unused struct sockaddr_nl variable Stefan Schmidt
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Stefan Schmidt @ 2015-11-10 21:42 UTC (permalink / raw)
  To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt

Hello.

I finished setting up Travis CI for builds and Coverity Scan service for wpan-tools on a private
GitHub fork. If nobody has a strong opinion against this I would like to set it up on the main repo
so we can have a first step towards some automated QA infrastructure.

But lets first have a look at the results from this first run. As you can see on the our first
run revealed 4 defects in 23321 lines of code (after the C preprocessor). With a defect density
of 0.17 this is way below industry average which is set to one here. In other words this means
we only have 1.7 defects per 10000 lines of code.

Three of these have been problems in error pathes of the code (leak, no check on return value, etc)
and one have been a false positive in the main iwpan.c file. Coverity was not able to understand
that we set err in our netlinks callbacks and thought this code bit would never stop as we start
with err = 1

while (err > 0)
	nl_recvmsgs(state->nl_sock, cb);

I marked it as false positive and fixed the remaining three defects with the patches below.

Stefan Schmidt (4):
  wpan-ping: remove unused struct sockaddr_nl variable
  wpan-ping: check return value for setsockopt
  wpan-ping: do not try to send data back to origin if we got an error
    from recvfrom
  wpan-ping: avoid leaking socket handle on error path

 wpan-ping/wpan-ping.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

regards
Stefan Schmidt
-- 
2.4.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-12  8:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-10 21:42 [PATCH wpan-tools 0/4] Coverity fixes for wpan-ping Stefan Schmidt
2015-11-10 21:42 ` [PATCH wpan-tools 1/4] wpan-ping: remove unused struct sockaddr_nl variable Stefan Schmidt
2015-11-10 21:42 ` [PATCH wpan-tools 2/4] wpan-ping: check return value for setsockopt Stefan Schmidt
2015-11-10 21:42 ` [PATCH wpan-tools 3/4] wpan-ping: do not try to send data back to origin if we got an error from recvfrom Stefan Schmidt
2015-11-10 21:42 ` [PATCH wpan-tools 4/4] wpan-ping: avoid leaking socket handle on error path Stefan Schmidt
2015-11-12  8:39 ` [PATCH wpan-tools 0/4] Coverity fixes for wpan-ping Stefan Schmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).