DFU: make sure to properly initialize g_dfu pointer before using it

This commit is contained in:
Harald Welte
2017-03-03 01:05:22 +01:00
parent b04f4f0ee8
commit 91fc40240e
2 changed files with 5 additions and 0 deletions

View File

@@ -154,6 +154,9 @@ void ResetException( void )
#if defined(BOARD_USB_DFU) && defined(APPLICATION_dfu)
/* we are before the text segment has been relocated, so g_dfu is
* not initialized yet */
g_dfu = &_g_dfu;
if (g_dfu->magic != USB_DFU_MAGIC) {
BootIntoApp();
/* Infinite loop */