Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Mock Turtle
Commits
789c76fa
Commit
789c76fa
authored
Aug 01, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:fw: avoid NULL pointer usage
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
11c33316
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
mockturtle-framework.c
software/firmware/framework/mockturtle-framework.c
+6
-4
No files found.
software/firmware/framework/mockturtle-framework.c
View file @
789c76fa
...
...
@@ -80,7 +80,7 @@ static int trtl_fw_buffer(struct trtl_fw_msg *msg_i, struct trtl_fw_msg *msg_o)
struct
trtl_fw_buffer
*
buf
;
unsigned
int
offset
=
0
,
index
,
size
;
uint32_t
*
din
;
uint32_t
*
dout
;
uint32_t
*
dout
=
NULL
;
if
(
!
HAS_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE
)
{
return
-
EPERM
;
...
...
@@ -122,9 +122,11 @@ static int trtl_fw_buffer(struct trtl_fw_msg *msg_i, struct trtl_fw_msg *msg_o)
memcpy
(
buf
->
buf
,
&
din
[
offset
+
2
],
size
);
/* After a set we always read back => get */
case
TRTL_MSG_ID_BUF_GET
:
dout
[
offset
+
0
]
=
index
;
dout
[
offset
+
1
]
=
size
;
memcpy
(
&
dout
[
offset
+
2
],
buf
->
buf
,
size
);
if
(
dout
)
{
dout
[
offset
+
0
]
=
index
;
dout
[
offset
+
1
]
=
size
;
memcpy
(
&
dout
[
offset
+
2
],
buf
->
buf
,
size
);
}
break
;
default:
return
-
EINVAL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment