Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
752fa5fd
Commit
752fa5fd
authored
Nov 08, 2024
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nr rlc: hotfix: test allocation valid before use
and simplify a bit (DevAssert instead of goto/exit)
parent
220d851d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
openair2/LAYER2/nr_rlc/nr_rlc_sdu.c
openair2/LAYER2/nr_rlc/nr_rlc_sdu.c
+5
-8
No files found.
openair2/LAYER2/nr_rlc/nr_rlc_sdu.c
View file @
752fa5fd
...
...
@@ -32,13 +32,14 @@ nr_rlc_sdu_segment_t *nr_rlc_new_sdu(
{
/* allocate sdu header and data together */
nr_rlc_sdu_t
*
sdu
=
malloc
(
sizeof
(
nr_rlc_sdu_t
)
+
size
);
nr_rlc_sdu_segment_t
*
ret
=
calloc
(
1
,
sizeof
(
nr_rlc_sdu_segment_t
));
DevAssert
(
sdu
!=
NULL
);
DevAssert
(
ret
!=
NULL
);
/* only memset the header */
memset
(
sdu
,
0
,
sizeof
(
*
sdu
));
nr_rlc_sdu_segment_t
*
ret
=
calloc
(
1
,
sizeof
(
nr_rlc_sdu_segment_t
));
if
(
sdu
==
NULL
||
ret
==
NULL
)
goto
oom
;
sdu
->
ref_count
=
1
;
sdu
->
sn
=
-
1
;
/* set later */
sdu
->
upper_layer_id
=
upper_layer_id
;
...
...
@@ -54,10 +55,6 @@ nr_rlc_sdu_segment_t *nr_rlc_new_sdu(
ret
->
is_last
=
1
;
return
ret
;
oom:
LOG_E
(
RLC
,
"%s:%d:%s: out of memory
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
int
nr_rlc_free_sdu_segment
(
nr_rlc_sdu_segment_t
*
sdu
)
...
...
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