Coverity CID 200651: pci_specified_resource_alignment() integer overflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Coverity complains about unintentional integer overflow in
pci_specified_resource_alignment():

CID 200651 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression 1 <<
align_order with type int (32 bits, signed) is evaluated using 32-bit
arithmetic before being used in a context which expects an expression
of type resource_size_t (64 bits, unsigned). To avoid overflow, cast
the left operand to resource_size_t before performing the left shift.

4219                                align = 1 << align_order;

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux