]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme: fix overflow possiblity
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Fri, 3 Nov 2023 00:53:50 +0000 (09:53 +0900)
committerDaniel Wagner <wagi@monom.org>
Fri, 3 Nov 2023 08:53:51 +0000 (09:53 +0100)
commit024395655ddc95955e96663de70360f92cc3d0f9
tree8970d0cefa613afe0d5016948b42326a7c301ee1
parent8e737c1bb08427c2811ed4cc9d663a1d3bb18411
nvme: fix overflow possiblity

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>
nvme.c