Commit 0b66fb3e authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jiri Kosina

HID: intel-ish-hid: avoid bogus uninitialized-variable warning

Older compilers like gcc-4.8 don't see that the variable is
initialized when it is used:

In file included from include/linux/compiler_types.h:68:0,
                 from <command-line>:0:
drivers/hid/intel-ish-hid/ishtp-fw-loader.c: In function 'load_fw_from_host':
include/linux/compiler-gcc.h:75:45: warning: 'fw_info.ldr_capability.max_dma_buf_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
                                             ^
drivers/hid/intel-ish-hid/ishtp-fw-loader.c:770:22: note: 'fw_info.ldr_capability.max_dma_buf_size' was declared here
  struct shim_fw_info fw_info;
                      ^

Make sure to initialize it before returning an error from ish_query_loader_prop().

Fixes: 91b22810 ("HID: intel-ish-hid: ISH firmware loader client driver")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 47cf1b42
...@@ -480,6 +480,7 @@ static int ish_query_loader_prop(struct ishtp_cl_data *client_data, ...@@ -480,6 +480,7 @@ static int ish_query_loader_prop(struct ishtp_cl_data *client_data,
sizeof(ldr_xfer_query_resp)); sizeof(ldr_xfer_query_resp));
if (rv < 0) { if (rv < 0) {
client_data->flag_retry = true; client_data->flag_retry = true;
*fw_info = (struct shim_fw_info){};
return rv; return rv;
} }
...@@ -489,6 +490,7 @@ static int ish_query_loader_prop(struct ishtp_cl_data *client_data, ...@@ -489,6 +490,7 @@ static int ish_query_loader_prop(struct ishtp_cl_data *client_data,
"data size %d is not equal to size of loader_xfer_query_response %zu\n", "data size %d is not equal to size of loader_xfer_query_response %zu\n",
rv, sizeof(struct loader_xfer_query_response)); rv, sizeof(struct loader_xfer_query_response));
client_data->flag_retry = true; client_data->flag_retry = true;
*fw_info = (struct shim_fw_info){};
return -EMSGSIZE; return -EMSGSIZE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment