programmer.h: Convert anon union to anon struct

Convert the anon union of registered masters in the mst
field of the flashctx to a anon struct. If we are going
to dereference a pointer there in an undefined way we
should crash and not plow ahead with invalid memory.

The user of the registered_masters type is therefore
responsible for querying the buses_supported field before
attempting to dereference a ptr field in the anon struct.

TEST=`flashrom -p internal --flash-name`

Change-Id: I576967a8599b923c902e39f177f39146291cc242
Signed-off-by: Edward O'Callaghan <>
Reviewed-by: Anastasia Klimchuk <>
Reviewed-by: Peter Marheine <>
Reviewed-by: Daniel Campello <>
Reviewed-by: Sam McNally <>
Tested-by: build bot (Jenkins) <>
diff --git a/programmer.c b/programmer.c
index bee60e3..42ea2e3 100644
--- a/programmer.c
+++ b/programmer.c
@@ -83,7 +83,8 @@
 int register_par_master(const struct par_master *mst,
 			    const enum chipbustype buses)
-	struct registered_master rmst;
+	struct registered_master rmst = {0};
 	if (!mst->chip_writeb || !mst->chip_writew || !mst->chip_writel ||
 	    !mst->chip_writen || !mst->chip_readb || !mst->chip_readw ||
 	    !mst->chip_readl || !mst->chip_readn) {