mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-19 23:08:34 +03:00
DFU: make sure to properly initialize g_dfu pointer before using it
This commit is contained in:
@@ -97,6 +97,8 @@ struct dfudata {
|
|||||||
unsigned int total_bytes;
|
unsigned int total_bytes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* RAM address for this magic value above */
|
||||||
|
extern struct dfudata _g_dfu;
|
||||||
extern struct dfudata *g_dfu;
|
extern struct dfudata *g_dfu;
|
||||||
|
|
||||||
void set_usb_serial_str(const uint8_t *serial_usbstr);
|
void set_usb_serial_str(const uint8_t *serial_usbstr);
|
||||||
|
|||||||
@@ -154,6 +154,9 @@ void ResetException( void )
|
|||||||
|
|
||||||
|
|
||||||
#if defined(BOARD_USB_DFU) && defined(APPLICATION_dfu)
|
#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) {
|
if (g_dfu->magic != USB_DFU_MAGIC) {
|
||||||
BootIntoApp();
|
BootIntoApp();
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
|
|||||||
Reference in New Issue
Block a user