wl12xx: fix mem leak in the channel switch command

Channel switch command wasn't freed in certain sanity check,
fix this by moving the check before the command allocation.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wl12xx: fix unset ret value in wl1271_join

Set the ret value before the return statement.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
wl12xx: fix unsafe dereference of the wlvif

wlvif could be passed as NULL from the wl1271_tx_work_locked()
to the wl1271_prepare_tx_frame() function. This may lead to a
Kernel panic, fix this by validating that wlvif != NULL before
using it.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>