Skip to content

Commit

Permalink
esp_semihosting: fix null pointer access error
Browse files Browse the repository at this point in the history
  • Loading branch information
erhankur committed Jul 4, 2022
1 parent e47989e commit 7a32ea1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/target/espressif/esp_semihosting.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ static int remove_from_dir_map_list(struct dir_map *dir_map, struct target *targ
static int clean_dir_map_list(struct target *target)
{
struct esp_semihost_data *semihost_data = target_to_esp_semihost_data(target);

if (!semihost_data)
return ERROR_OK;

int ret = list_empty(&semihost_data->dir_map_list);
if (!ret) {
struct dir_map *dir_map;
Expand Down

0 comments on commit 7a32ea1

Please sign in to comment.