cros_ec: Fix uninitialised variable in cros_ec.c
authorSimon Glass <sjg@chromium.org>
Wed, 12 Nov 2014 01:06:30 +0000 (18:06 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 22 Nov 2014 09:16:48 +0000 (10:16 +0100)
This fixes this cppcheck report:

[drivers/misc/cros_ec.c:704]: (error) Uninitialized variable: req

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Wolfgang Denk <wd@denx.de>
drivers/misc/cros_ec.c

index 521edfd5de5cf5698ff98c1627e30703c3649282..9b4effb2fb56cda2fcba39d1a5ee80fe084384b8 100644 (file)
@@ -701,6 +701,7 @@ static int cros_ec_check_version(struct cros_ec_dev *dev)
 
        /* Try sending a version 3 packet */
        dev->protocol_version = 3;
+       req.in_data = 0;
        if (ec_command_inptr(dev, EC_CMD_HELLO, 0, &req, sizeof(req),
                             (uint8_t **)&resp, sizeof(*resp)) > 0) {
                return 0;