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
6370ad25
Commit
6370ad25
authored
3 months ago
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use calloc_or_fail whenever possible
parent
86725135
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
14 deletions
+7
-14
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+3
-6
openair2/RRC/NR/rrc_gNB_mobility.c
openair2/RRC/NR/rrc_gNB_mobility.c
+4
-8
No files found.
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
6370ad25
...
...
@@ -1416,15 +1416,12 @@ int do_NR_Paging(uint8_t Mod_id, uint8_t *buffer, uint32_t tmsi)
* in encoded form which we decode + add to the handoverPreparationInformation */
int
do_NR_HandoverPreparationInformation
(
const
uint8_t
*
uecap_buf
,
int
uecap_buf_size
,
uint8_t
*
buf
,
int
buf_size
)
{
NR_HandoverPreparationInformation_t
*
hpi
=
calloc
(
1
,
sizeof
(
*
hpi
));
AssertFatal
(
hpi
!=
NULL
,
"out of memory
\n
"
);
NR_HandoverPreparationInformation_t
*
hpi
=
calloc_or_fail
(
1
,
sizeof
(
*
hpi
));
hpi
->
criticalExtensions
.
present
=
NR_HandoverPreparationInformation__criticalExtensions_PR_c1
;
hpi
->
criticalExtensions
.
choice
.
c1
=
calloc
(
1
,
sizeof
(
*
hpi
->
criticalExtensions
.
choice
.
c1
));
AssertFatal
(
hpi
->
criticalExtensions
.
choice
.
c1
!=
NULL
,
"out of memory
\n
"
);
hpi
->
criticalExtensions
.
choice
.
c1
=
calloc_or_fail
(
1
,
sizeof
(
*
hpi
->
criticalExtensions
.
choice
.
c1
));
hpi
->
criticalExtensions
.
choice
.
c1
->
present
=
NR_HandoverPreparationInformation__criticalExtensions__c1_PR_handoverPreparationInformation
;
NR_HandoverPreparationInformation_IEs_t
*
hpi_ie
=
calloc
(
1
,
sizeof
(
*
hpi_ie
));
AssertFatal
(
hpi_ie
!=
NULL
,
"out of memory
\n
"
);
NR_HandoverPreparationInformation_IEs_t
*
hpi_ie
=
calloc_or_fail
(
1
,
sizeof
(
*
hpi_ie
));
hpi
->
criticalExtensions
.
choice
.
c1
->
choice
.
handoverPreparationInformation
=
hpi_ie
;
NR_UE_CapabilityRAT_ContainerList_t
*
list
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
openair2/RRC/NR/rrc_gNB_mobility.c
View file @
6370ad25
...
...
@@ -39,15 +39,12 @@
typedef
enum
{
HO_CTX_BOTH
,
HO_CTX_SOURCE
,
HO_CTX_TARGET
}
ho_ctx_type_t
;
static
nr_handover_context_t
*
alloc_ho_ctx
(
ho_ctx_type_t
type
)
{
nr_handover_context_t
*
ho_ctx
=
calloc
(
1
,
sizeof
(
*
ho_ctx
));
AssertFatal
(
ho_ctx
!=
NULL
,
"out of memory
\n
"
);
nr_handover_context_t
*
ho_ctx
=
calloc_or_fail
(
1
,
sizeof
(
*
ho_ctx
));
if
(
type
==
HO_CTX_SOURCE
||
type
==
HO_CTX_BOTH
)
{
ho_ctx
->
source
=
calloc
(
1
,
sizeof
(
*
ho_ctx
->
source
));
AssertFatal
(
ho_ctx
->
source
!=
NULL
,
"out of memory
\n
"
);
ho_ctx
->
source
=
calloc_or_fail
(
1
,
sizeof
(
*
ho_ctx
->
source
));
}
if
(
type
==
HO_CTX_TARGET
||
type
==
HO_CTX_BOTH
)
{
ho_ctx
->
target
=
calloc
(
1
,
sizeof
(
*
ho_ctx
->
target
));
AssertFatal
(
ho_ctx
->
target
!=
NULL
,
"out of memory
\n
"
);
ho_ctx
->
target
=
calloc_or_fail
(
1
,
sizeof
(
*
ho_ctx
->
target
));
}
return
ho_ctx
;
}
...
...
@@ -157,8 +154,7 @@ static void nr_initiate_handover(const gNB_RRC_INST *rrc,
// this changes
AssertFatal
(
pdu
->
param
.
nb_qos
==
1
,
"only 1 Qos flow supported
\n
"
);
drb
->
drb_info
.
flows_to_be_setup_length
=
1
;
drb
->
drb_info
.
flows_mapped_to_drb
=
calloc
(
1
,
sizeof
(
f1ap_flows_mapped_to_drb_t
));
AssertFatal
(
drb
->
drb_info
.
flows_mapped_to_drb
,
"could not allocate memory
\n
"
);
drb
->
drb_info
.
flows_mapped_to_drb
=
calloc_or_fail
(
1
,
sizeof
(
f1ap_flows_mapped_to_drb_t
));
int
qfi
=
rrc_drb
->
cnAssociation
.
sdap_config
.
mappedQoS_FlowsToAdd
[
0
];
DevAssert
(
qfi
>
0
);
drb
->
drb_info
.
flows_mapped_to_drb
[
0
].
qfi
=
qfi
;
...
...
This diff is collapsed.
Click to expand it.
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