1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

Add missing variable initialization in MSP_VTX_CONFIG

If the `vtxDevice` was not valid then the `vtxStatus` variable never got initialized but was still used in the pit mode flag determination - leading to random behavior.
This commit is contained in:
Bruce Luckcuck 2019-09-11 09:00:51 -04:00
parent 2a18209492
commit ad4d46a1f9

View file

@ -1676,7 +1676,7 @@ static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
case MSP_VTX_CONFIG: case MSP_VTX_CONFIG:
{ {
const vtxDevice_t *vtxDevice = vtxCommonDevice(); const vtxDevice_t *vtxDevice = vtxCommonDevice();
unsigned vtxStatus; unsigned vtxStatus = 0;
vtxDevType_e vtxType = VTXDEV_UNKNOWN; vtxDevType_e vtxType = VTXDEV_UNKNOWN;
uint8_t deviceIsReady = 0; uint8_t deviceIsReady = 0;
if (vtxDevice) { if (vtxDevice) {