OSDN Git Service

acpi/erst: fix fallthrough code upon validation failure
authorAni Sinha <ani@anisinha.ca>
Fri, 13 May 2022 14:10:05 +0000 (19:40 +0530)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 16 Jun 2022 16:54:58 +0000 (12:54 -0400)
commit8c97e4deeca9ad791ab369d3879ebfb0267b24ca
tree357c9bca94e0d94203d8bc2ebaa967e5fc655377
parent9ce305c8beb9ba7edacd0585139cce56a195c1da
acpi/erst: fix fallthrough code upon validation failure

At any step when any validation fail in check_erst_backend_storage(), there is
no need to continue further through other validation checks. Further, by
continuing even when record_size is 0, we run the risk of triggering a divide
by zero error if we continued with other validation checks. Hence, we should
simply return from this function upon validation failure.

CC: Peter Maydell <peter.maydell@linaro.org>
CC: Eric DeVolder <eric.devolder@oracle.com>
Signed-off-by: Ani Sinha <ani@anisinha.ca>
Message-Id: <20220513141005.1929422-1-ani@anisinha.ca>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric DeVolder <eric.devolder@oracle.com>
hw/acpi/erst.c