dummyflasher.c: Fix data leak in params processing error paths
This patch extracts params processing into a separate function. Now
all error paths of params processing return 1 back to init function
which frees data.
And there was just one more error path in init function where
free(data) needed to be added.
This is a follow up on commit 3b8fe0f8e907c0ba9f7c7935e950f3e1538d427f
which moves global state into spi_master data.
A good side-effect of the change is: init function becomes easier
Signed-off-by: Anastasia Klimchuk <email@example.com>
Tested-by: build bot (Jenkins) <firstname.lastname@example.org>
Reviewed-by: Nico Huber <email@example.com>
1 file changed