spi: sandbox: Fix memory leak in sandbox_sf_bind_emul()
authorSimon Glass <sjg@chromium.org>
Tue, 12 Jun 2018 06:05:01 +0000 (00:05 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 19 Jun 2018 11:31:44 +0000 (07:31 -0400)
commitfb95283931011aef78d885f2799ad9d7367f4e48
tree37b3d2f8be779022f3bc6ed28ce6feb7ebdfb2f7
parent8a682e03d7d18b3d20810ea83fcec69f8d09c909
spi: sandbox: Fix memory leak in sandbox_sf_bind_emul()

Move the strdup() call so that it is only done when we know we will bind
the device.

Reported-by: Coverity (CID: 131216)
Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/mtd/spi/sandbox.c