diff options
author | Cyril Bur <cyril.bur@au1.ibm.com> | 2017-01-19 10:49:34 +1100 |
---|---|---|
committer | Cyril Bur <cyril.bur@au1.ibm.com> | 2017-01-25 11:43:34 +1100 |
commit | ef315c17f50f40d4385f8b9c01012f8b2c9aa0f8 (patch) | |
tree | 008d39d4fa3f2156aa53431af79399529b8eb067 | |
parent | 8cb799c2d6c2675959e80f2a7b88610aa4f4817a (diff) | |
download | phosphor-mboxd-ef315c17f50f40d4385f8b9c01012f8b2c9aa0f8.tar.gz phosphor-mboxd-ef315c17f50f40d4385f8b9c01012f8b2c9aa0f8.zip |
mboxd: Zero ioctl() map struct
Change-Id: I5528432af3e211bbac7d86cdf7e57beb0d1a6c0b
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
-rw-r--r-- | mboxd.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -79,7 +79,7 @@ static int sighup = 0; static int point_to_flash(struct mbox_context *context) { - struct aspeed_lpc_ctrl_mapping map; + struct aspeed_lpc_ctrl_mapping map = { 0 }; int r = 0; /* @@ -97,7 +97,8 @@ static int point_to_flash(struct mbox_context *context) /* * The mask is because the top nibble is the host LPC FW space, we - * want space 0 + * want space 0. The struct has been zeroed, best to be explicit + * though. */ map.addr = (0UL - context->flash_size) & 0x0fffffff; map.size = context->flash_size; @@ -167,7 +168,7 @@ static int dispatch_mbox(struct mbox_context *context) union mbox_regs resp, req = { 0 }; uint16_t sizepg, basepg, dirtypg; uint32_t dirtycount; - struct aspeed_lpc_ctrl_mapping map; + struct aspeed_lpc_ctrl_mapping map = { 0 }; assert(context); @@ -369,7 +370,7 @@ int main(int argc, char *argv[]) const char *name = argv[0]; char *pnor_filename = NULL; int opt, polled, r, i; - struct aspeed_lpc_ctrl_mapping map; + struct aspeed_lpc_ctrl_mapping map = { 0 }; struct sigaction act; char *endptr; |