[SeaBIOS] Coverity detected issues in SeaBIOS

Markus Armbruster armbru at redhat.com
Thu Jul 17 14:58:51 CEST 2014


"Kevin O'Connor" <kevin at koconnor.net> writes:

> On Wed, Jul 16, 2014 at 04:27:18PM +0100, Ian Campbell wrote:
>> Hello,
>> 
>> We run Coverity on the Xen source code occasionally and it happens to
>> include SeaBIOS. The following new warnings have appeared since I pulled
>> in rel-1.7.5.
>
> Thanks.  All five look like false positives to me.  I'm happy to take
> patches if you want to rework the code to prevent the warnings.
>
>> At least the MISSING_BREAK ones look likely to be valid to me. Not sure
>> about the other two...
>
> It's a bit ugly, but it should be okay because all three cases start
> with "if (!MODESEGMENT)" which is a compile time constant.  So, when
> compiled in 32bit mode the three cases will each return the results
> from their respective functions, and in 16bit mode all three will
> return DISK_RET_EPARAM.

A comment would make your intention clearn and shut up Coverity:

        case DTYPE_USB_32:
            if (!MODESEGMENT)
                return usb_cmd_data(op, cdbcmd, blocksize);
            /* fall through */
        case DTYPE_UAS_32:
            if (!MODESEGMENT)
                return uas_cmd_data(op, cdbcmd, blocksize);



More information about the SeaBIOS mailing list