From 38870253f1d17f872f4d2a9c6d8e2989ec3706a9 Mon Sep 17 00:00:00 2001 From: Titus Rwantare <titusr@google.com> Date: Mon, 7 Mar 2022 12:05:58 -0800 Subject: hw/i2c: pmbus: fix error returns and guard against out of range accesses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Titus Rwantare <titusr@google.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Corey Minyard <cminyard@mvista.com> Message-Id: <20220307200605.4001451-3-titusr@google.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- include/hw/i2c/pmbus_device.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/hw/i2c') diff --git a/include/hw/i2c/pmbus_device.h b/include/hw/i2c/pmbus_device.h index 72c0483..bab4526 100644 --- a/include/hw/i2c/pmbus_device.h +++ b/include/hw/i2c/pmbus_device.h @@ -228,6 +228,8 @@ enum pmbus_registers { #define PB_MAX_PAGES 0x1F #define PB_ALL_PAGES 0xFF +#define PMBUS_ERR_BYTE 0xFF + #define TYPE_PMBUS_DEVICE "pmbus-device" OBJECT_DECLARE_TYPE(PMBusDevice, PMBusDeviceClass, PMBUS_DEVICE) -- cgit v1.1