ieee802154_scan() checks if ctx->scan_ctx (scan) is NULL what implies that this can be true, but de-reference this variable before this check what may cause a problem. Fixes #23299 [3] Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>