The implicit type conversion will expand both operands to the type
int and not unsigned long long as the result expects. Promote
the first operand to the target type. Obviously the multiplication
can still overflow, but this is a different problem.
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: added commit message]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
nblocks = ((buffer_size + (logical_block_size - 1)) / logical_block_size) - 1;
/* Update the data size based on the required block count */
- buffer_size = (nblocks + 1) * logical_block_size;
+ buffer_size = ((unsigned long long)nblocks + 1) * logical_block_size;
}
buffer = nvme_alloc_huge(buffer_size, &huge);