Render double teardown() harmless in avrftdi.c

This commit is contained in:
Stefan Rueger
2024-04-22 16:15:32 +01:00
parent 9278b5655d
commit e014cfc9b0

View File

@@ -1232,12 +1232,12 @@ static void avrftdi_setup(PROGRAMMER * pgm) {
}
static void avrftdi_teardown(PROGRAMMER * pgm) {
avrftdi_t* pdata = to_pdata(pgm);
if(pdata) {
if(pgm->cookie) {
avrftdi_t *pdata = to_pdata(pgm);
ftdi_deinit(pdata->ftdic);
ftdi_free(pdata->ftdic);
mmt_free(pdata);
pgm->cookie = NULL;
}
}