]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/mem/cxl_type3: Fix potential divide by zero reported by coverity
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 26 Jan 2024 12:01:29 +0000 (12:01 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 14 Feb 2024 11:09:32 +0000 (06:09 -0500)
commit48461825af1bdc68cfa25fa0b698c958b65f7368
tree74b62e67e69e17deb0b5a931e06c710a6b99bd64
parentf8b02dd655cc20ca7f321c42acbffb143eb8372a
hw/mem/cxl_type3: Fix potential divide by zero reported by coverity

Fixes Coverity ID 1522368.

Currently error_fatal is set if interleave_ways_dec() is going to return 0
but we should handle that zero return explicitly.

Reported-by: Stefan Hajnoczi <stefanha@gmail.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20240126120132.24248-10-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/mem/cxl_type3.c