From: Dan Carpenter Date: Thu, 14 Apr 2016 09:33:37 +0000 (+0300) Subject: firmware: qemu_fw_cfg.c: potential unintialized variable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d4f6e272f2600bc1295d195a52a9e8bb81656bc7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git firmware: qemu_fw_cfg.c: potential unintialized variable It acpi_acquire_global_lock() return AE_NOT_CONFIGURED then "glk" isn't initialized, which, if you got very unlucky, could cause a bug. Signed-off-by: Dan Carpenter Signed-off-by: Michael S. Tsirkin --- diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index 815c4a5cae54..1b95475b6aef 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -77,7 +77,7 @@ static inline u16 fw_cfg_sel_endianness(u16 key) static inline void fw_cfg_read_blob(u16 key, void *buf, loff_t pos, size_t count) { - u32 glk; + u32 glk = -1U; acpi_status status; /* If we have ACPI, ensure mutual exclusion against any potential