From f01eb3808c7de8b001c3ce49556f2034c7768e82 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Sat, 10 Jul 2021 10:01:19 +0100 Subject: [PATCH] pixart-rf: Read the payload status after getting the command response Spotted by Coverity --- plugins/pixart-rf/fu-pxi-receiver-device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/pixart-rf/fu-pxi-receiver-device.c b/plugins/pixart-rf/fu-pxi-receiver-device.c index b1407b9b7..732408046 100644 --- a/plugins/pixart-rf/fu-pxi-receiver-device.c +++ b/plugins/pixart-rf/fu-pxi-receiver-device.c @@ -331,6 +331,9 @@ fu_pxi_receiver_device_write_payload (FuDevice *device, FuChunk *chk, GError **e if (!fu_pxi_receiver_device_get_cmd_response (self, buf, sizeof(buf), error)) return FALSE; + if (!fu_common_read_uint8_safe (buf, sizeof(buf), 0x5, &status, error)) + return FALSE; + if (status != OTA_RSP_OK) { g_set_error (error, FWUPD_ERROR,