[PATCH] * Bugfix in Firmware: initialising variables

Bhaskar niceguy108 at gmail.com
Wed May 22 07:38:02 UTC 2013


Under specific circumstances, these variables would have been used without
initialisation.

---
 src/target/firmware/apps/loader/main.c    |    2 +-
 src/target/firmware/layer1/mframe_sched.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/target/firmware/apps/loader/main.c
b/src/target/firmware/apps/loader/main.c
index 8bdbc74..c74c045 100644
--- a/src/target/firmware/apps/loader/main.c
+++ b/src/target/firmware/apps/loader/main.c
@@ -213,7 +213,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)

  uint8_t command = msgb_pull_u8(msg);

- int res;
+ int res = 0;

  flash_lock_t lock;

diff --git a/src/target/firmware/layer1/mframe_sched.c
b/src/target/firmware/layer1/mframe_sched.c
index f3a6b43..047d709 100644
--- a/src/target/firmware/layer1/mframe_sched.c
+++ b/src/target/firmware/layer1/mframe_sched.c
@@ -343,7 +343,7 @@ static const struct mframe_sched_item
*sched_set_for_task[32] = {
 /* encodes a channel number according to 08.58 Chapter 9.3.1 */
 uint8_t mframe_task2chan_nr(enum mframe_task mft, uint8_t ts)
 {
- uint8_t cbits;
+ uint8_t cbits = 0;

  switch (mft) {
  case MF_TASK_BCCH_NORM:
-- 
1.7.9

--047d7bdc15d456c2b204dd61e109
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><font face=3D"courier new, monospace">From d1ad22fa60=
e9d52bac246391b2fb6de57fb067b7 Mon Sep 17 00:00:00 2001</font></div><div><f=
ont face=3D"courier new, monospace">From: Bhaskar <<a href=3D"mailto:nic=
eguy108 at gmail.com">niceguy108 at gmail.com</a>></font></div>
<div><font face=3D"courier new, monospace">Date: Wed, 22 May 2013 13:08:02 =
+0530</font></div><div><font face=3D"courier new, monospace">Subject: [PATC=
H] * Bugfix in Firmware: initialising variables</font></div><div><font face=
=3D"courier new, monospace"><br>
</font></div><div><font face=3D"courier new, monospace">Under specific circ=
umstances, these variables would have been used without initialisation.</fo=
nt></div><div><font face=3D"courier new, monospace"><br></font></div><div><=
font face=3D"courier new, monospace">---</font></div>
<div><font face=3D"courier new, monospace">=A0src/target/firmware/apps/load=
er/main.c =A0 =A0| =A0 =A02 +-</font></div><div><font face=3D"courier new, =
monospace">=A0src/target/firmware/layer1/mframe_sched.c | =A0 =A02 +-</font=
></div><div><font face=3D"courier new, monospace">=A02 files changed, 2 ins=
ertions(+), 2 deletions(-)</font></div>
<div><font face=3D"courier new, monospace"><br></font></div><div><font face=
=3D"courier new, monospace">diff --git a/src/target/firmware/apps/loader/ma=
in.c b/src/target/firmware/apps/loader/main.c</font></div><div><font face=
=3D"courier new, monospace">index 8bdbc74..c74c045 100644</font></div>
<div><font face=3D"courier new, monospace">--- a/src/target/firmware/apps/l=
oader/main.c</font></div><div><font face=3D"courier new, monospace">+++ b/s=
rc/target/firmware/apps/loader/main.c</font></div><div><font face=3D"courie=
r new, monospace">@@ -213,7 +213,7 @@ static void cmd_handler(uint8_t dlci,=
 struct msgb *msg)</font></div>
<div><font face=3D"courier new, monospace">=A0</font></div><div><font face=
=3D"courier new, monospace">=A0<span class=3D"" style=3D"white-space:pre">	=
</span>uint8_t command =3D msgb_pull_u8(msg);</font></div><div><font face=
=3D"courier new, monospace">=A0</font></div>
<div><font face=3D"courier new, monospace">-<span class=3D"" style=3D"white=
-space:pre">	</span>int res;</font></div><div><font face=3D"courier new, mo=
nospace">+<span class=3D"" style=3D"white-space:pre">	</span>int res =3D 0;=
</font></div>
<div><font face=3D"courier new, monospace">=A0</font></div><div><font face=
=3D"courier new, monospace">=A0<span class=3D"" style=3D"white-space:pre">	=
</span>flash_lock_t lock;</font></div><div><font face=3D"courier new, monos=
pace">=A0</font></div>
<div><font face=3D"courier new, monospace">diff --git a/src/target/firmware=
/layer1/mframe_sched.c b/src/target/firmware/layer1/mframe_sched.c</font></=
div><div><font face=3D"courier new, monospace">index f3a6b43..047d709 10064=
4</font></div>
<div><font face=3D"courier new, monospace">--- a/src/target/firmware/layer1=
/mframe_sched.c</font></div><div><font face=3D"courier new, monospace">+++ =
b/src/target/firmware/layer1/mframe_sched.c</font></div><div><font face=3D"=
courier new, monospace">@@ -343,7 +343,7 @@ static const struct mframe_sche=
d_item *sched_set_for_task[32] =3D {</font></div>
<div><font face=3D"courier new, monospace">=A0/* encodes a channel number a=
ccording to 08.58 Chapter 9.3.1 */</font></div><div><font face=3D"courier n=
ew, monospace">=A0uint8_t mframe_task2chan_nr(enum mframe_task mft, uint8_t=
 ts)</font></div>
<div><font face=3D"courier new, monospace">=A0{</font></div><div><font face=
=3D"courier new, monospace">-<span class=3D"" style=3D"white-space:pre">	</=
span>uint8_t cbits;</font></div><div><font face=3D"courier new, monospace">=
+<span class=3D"" style=3D"white-space:pre">	</span>uint8_t cbits =3D 0;</f=
ont></div>
<div><font face=3D"courier new, monospace">=A0</font></div><div><font face=
=3D"courier new, monospace">=A0<span class=3D"" style=3D"white-space:pre">	=
</span>switch (mft) {</font></div><div><font face=3D"courier new, monospace=
">=A0<span class=3D"" style=3D"white-space:pre">	</span>case MF_TASK_BCCH_N=
ORM:</font></div>
<div><font face=3D"courier new, monospace">--=A0</font></div><div><font fac=
e=3D"courier new, monospace">1.7.9</font></div><div><br></div></div>

--047d7bdc15d456c2b204dd61e109--




More information about the baseband-devel mailing list