summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2013-09-26 18:39:13 +0200
committerSylvain Munaut <tnt@246tNt.com>2013-09-26 18:46:36 +0200
commitbf83e024a6f34ff8185e15d7fd5f1291c7453fe7 (patch)
treeed598e98e2448c804150c79073ffa5363422f4c7
parent8a8796802bc497f00b6a27ca14e2be0c9f9ec176 (diff)
Fix wrong msgb_pull usage
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--src/target/firmware/apps/loader/main.c4
-rw-r--r--src/target/firmware/apps/loader_mtk/main.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/target/firmware/apps/loader/main.c b/src/target/firmware/apps/loader/main.c
index 8bdbc74..39b8998 100644
--- a/src/target/firmware/apps/loader/main.c
+++ b/src/target/firmware/apps/loader/main.c
@@ -281,7 +281,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
crc = msgb_pull_u16(msg);
address = msgb_pull_u32(msg);
- data = msgb_pull(msg, nbytes);
+ data = msgb_pull(msg, nbytes) - nbytes;
mycrc = osmo_crc16(0, data, nbytes);
@@ -399,7 +399,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
chip = msgb_pull_u8(msg);
address = msgb_pull_u32(msg);
- data = msgb_pull(msg, nbytes);
+ data = msgb_pull(msg, nbytes) - nbytes;
mycrc = osmo_crc16(0, data, nbytes);
diff --git a/src/target/firmware/apps/loader_mtk/main.c b/src/target/firmware/apps/loader_mtk/main.c
index 43fbb56..f2ebbea 100644
--- a/src/target/firmware/apps/loader_mtk/main.c
+++ b/src/target/firmware/apps/loader_mtk/main.c
@@ -215,7 +215,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
crc = msgb_pull_u16(msg);
address = msgb_pull_u32(msg);
- data = msgb_pull(msg, nbytes);
+ data = msgb_pull(msg, nbytes) - nbytes;
mycrc = osmo_crc16(0, data, nbytes);
@@ -333,7 +333,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
chip = msgb_pull_u8(msg);
address = msgb_pull_u32(msg);
- data = msgb_pull(msg, nbytes);
+ data = msgb_pull(msg, nbytes) - nbytes;
mycrc = osmo_crc16(0, data, nbytes);