[PATCH 3.2 099/147] drivers/block/DAC960: fix -Wuninitialized warning

From: Ben Hutchings
Date: Mon Nov 06 2017 - 18:40:24 EST


3.2.95-rc1 review patch. If anyone has any objections, please let me know.

------------------

From: Danny Kukawka <danny.kukawka@xxxxxxxxx>

commit cecd353a02fb1405c8a72a324b26b5acf97e7411 upstream.

Set CommandMailbox with memset before use it. Fix for:

drivers/block/DAC960.c: In function âDAC960_V1_EnableMemoryMailboxInterfaceâ:
arch/x86/include/asm/io.h:61:1: warning: âCommandMailbox.Bytes[12]â
may be used uninitialized in this function [-Wuninitialized]
drivers/block/DAC960.c:1175:30: note: âCommandMailbox.Bytes[12]â
was declared here

Signed-off-by: Danny Kukawka <danny.kukawka@xxxxxxxxx>
Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
drivers/block/DAC960.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -1177,7 +1177,8 @@ static bool DAC960_V1_EnableMemoryMailbo
int TimeoutCounter;
int i;

-
+ memset(&CommandMailbox, 0, sizeof(DAC960_V1_CommandMailbox_T));
+
if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32)))
return DAC960_Failure(Controller, "DMA mask out of range");
Controller->BounceBufferLimit = DMA_BIT_MASK(32);