Page MenuHomeFreeBSD

Missing "else" in cascaded condition (if)
ClosedPublic

Authored by danfe on May 24 2019, 9:18 AM.

Details

Summary

PVS Studio reported error: V646 Consider inspecting the application's logic. It's possible that 'else' keyword is missing in two device drivers. Consider attached patch that fixes it.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 24470

Event Timeline

danfe created this revision.May 24 2019, 9:18 AM
gallatin accepted this revision.May 24 2019, 1:13 PM

I tend to think that neither of these is actually a problem, since in both cases, if the "if" is taken, we return or jump. But the fix seems harmless.

BTW, when uploading patches if not using arcanist, please provide full context. You can do that in git with diff -U9999999 (this is what I do, I don't care for the arcanist stuff).

This revision is now accepted and ready to land.May 24 2019, 1:13 PM
danfe added a comment.May 24 2019, 1:34 PM

Thanks; since I'm not an src committer, I'd wait for at least another LGTM review.

I'll remember to do a full context diff next time, once I figure out how to do that with Subversion (I'm not sure why people often suggest Git commands in FreeBSD context).

np accepted this revision.May 24 2019, 6:44 PM
pfg accepted this revision.May 25 2019, 3:22 AM

The changes seem correct.
I don't think a simple phabricator acceptance from a committer is suficient approval for a non src committer though, so I hereby explicitly approve it.

I'll remember to do a full context diff next time, once I figure out how to do that with Subversion (I'm not sure why people often suggest Git commands in FreeBSD context).

It's mentioned in https://wiki.freebsd.org/Phabricator#Create_a_Revision_via_Web_Interface

This revision was automatically updated to reflect the committed changes.