[PATCH V2 03/12] nvmet: use consistent type with id->nlbaf

Keith Busch kbusch at kernel.org
Tue Sep 1 11:55:57 EDT 2020


On Mon, Aug 31, 2020 at 03:26:58PM -0700, Chaitanya Kulkarni wrote:
> In function nvmet_passthru_override_id_ns() while iterating
> over namespace lba format loop variable is declared as int that is
> inconsistent with the id->nlbaf type which is u8.
> 
> Make loop variable of the same type as id->nlbaf.

The loop is id->nlbaf + 1, so it'd overflow if the nlbaf value is the max
u8. Sure, it doesn't get that large today, but they're always trying to
make it bigger. And there's really nothing wrong with counting for loops
with 'int i' anyway.



More information about the Linux-nvme mailing list