]> git.proxmox.com Git - fwupd.git/commitdiff
cros-ec: Fix an uninitialized buffer warning from valgrind
authorRichard Hughes <richard@hughsie.com>
Thu, 9 Feb 2023 20:27:13 +0000 (20:27 +0000)
committerMario Limonciello <mario.limonciello@amd.com>
Thu, 23 Feb 2023 19:04:11 +0000 (13:04 -0600)
plugins/cros-ec/fu-cros-ec-usb-device.c

index ac91eb0b4cf9fa5c6284ee735e7dca7b930f8926..b32493509a9134290aae2316f021c0b5ce33f0f0 100644 (file)
@@ -702,9 +702,9 @@ fu_cros_ec_usb_device_send_subcommand(FuDevice *device,
 static gboolean
 fu_cros_ec_usb_device_reset_to_ro(FuDevice *device, GError **error)
 {
-       guint8 response;
+       guint8 response = 0x0;
        guint16 subcommand = UPDATE_EXTRA_CMD_IMMEDIATE_RESET;
-       guint8 command_body[2]; /* Max command body size. */
+       guint8 command_body[2] = {0x0}; /* max command body size */
        gsize command_body_size = 0;
        gsize response_size = 1;
        g_autoptr(GError) error_local = NULL;
@@ -729,9 +729,9 @@ fu_cros_ec_usb_device_reset_to_ro(FuDevice *device, GError **error)
 static gboolean
 fu_cros_ec_usb_device_jump_to_rw(FuDevice *device)
 {
-       guint8 response;
+       guint8 response = 0x0;
        guint16 subcommand = UPDATE_EXTRA_CMD_JUMP_TO_RW;
-       guint8 command_body[2]; /* Max command body size. */
+       guint8 command_body[2] = {0x0}; /* max command body size */
        gsize command_body_size = 0;
        gsize response_size = 1;
 
@@ -767,9 +767,9 @@ static gboolean
 fu_cros_ec_usb_device_stay_in_ro(FuDevice *device, GError **error)
 {
        gsize response_size = 1;
-       guint8 response;
+       guint8 response = 0x0;
        guint16 subcommand = UPDATE_EXTRA_CMD_STAY_IN_RO;
-       guint8 command_body[2]; /* Max command body size. */
+       guint8 command_body[2] = {0x0}; /* max command body size */
        gsize command_body_size = 0;
 
        if (!fu_cros_ec_usb_device_send_subcommand(device,