Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9a76aa4 authored by Manoj Prabhu B's avatar Manoj Prabhu B
Browse files

diag: dci: Prevent using uninitialized variables



Presently chance of using uninitialized variables if a dci
command is not found is avoided by initializing command
structure variables.

Change-Id: I190299917ea6c7fadfc7686d43a7da098e0bc05e
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent 0fe1d128
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2091,6 +2091,11 @@ static int diag_process_dci_pkt_rsp(unsigned char *buf, int len)
	if ((ret == DIAG_DCI_NO_ERROR && !common_cmd) || ret < 0)
		return ret;

	reg_entry.cmd_code = 0;
	reg_entry.subsys_id = 0;
	reg_entry.cmd_code_hi = 0;
	reg_entry.cmd_code_lo = 0;

	if (header_len >= (sizeof(uint8_t)))
		reg_entry.cmd_code = header->cmd_code;
	if (header_len >= (2 * sizeof(uint8_t)))