Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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 UE
Commits
7f3fa2c6
Commit
7f3fa2c6
authored
Nov 23, 2021
by
Melissa Elkadi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checking for pointers to be NULL before allocating memory
parent
bd846e15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
+16
-4
No files found.
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
View file @
7f3fa2c6
...
...
@@ -318,7 +318,10 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_
uint16_t
num_dcis
=
pdu_list
->
pdcch_pdu
.
pdcch_pdu_rel15
.
numDlDci
;
if
(
num_dcis
>
0
)
{
dl_info
->
dci_ind
=
CALLOC
(
1
,
sizeof
(
fapi_nr_dci_indication_t
));
if
(
!
dl_info
->
dci_ind
)
{
dl_info
->
dci_ind
=
CALLOC
(
1
,
sizeof
(
fapi_nr_dci_indication_t
));
}
dl_info
->
dci_ind
->
SFN
=
dl_tti_request
->
SFN
;
dl_info
->
dci_ind
->
slot
=
dl_tti_request
->
Slot
;
AssertFatal
(
num_dcis
<=
sizeof
(
dl_info
->
dci_ind
->
dci_list
)
/
sizeof
(
dl_info
->
dci_ind
->
dci_list
[
0
]),
...
...
@@ -362,7 +365,10 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_
will be freed after handling. This is why the PDU index will
always be zero for the RX_IND becasue we should not have more than
one MIB. */
dl_info
->
rx_ind
=
CALLOC
(
1
,
sizeof
(
*
dl_info
->
rx_ind
));
if
(
!
dl_info
->
rx_ind
)
{
dl_info
->
rx_ind
=
CALLOC
(
1
,
sizeof
(
*
dl_info
->
rx_ind
));
}
fapi_nr_rx_indication_t
*
rx_ind
=
dl_info
->
rx_ind
;
rx_ind
->
sfn
=
dl_tti_request
->
SFN
;
rx_ind
->
slot
=
dl_tti_request
->
Slot
;
...
...
@@ -412,7 +418,10 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi
int
num_pdus
=
tx_data_request
->
Number_of_PDUs
;
AssertFatal
(
num_pdus
>=
0
,
"Invalid tx_data_request number of PDUS
\n
"
);
dl_info
->
rx_ind
=
CALLOC
(
1
,
sizeof
(
fapi_nr_rx_indication_t
));
if
(
!
dl_info
->
rx_ind
)
{
dl_info
->
rx_ind
=
CALLOC
(
1
,
sizeof
(
fapi_nr_rx_indication_t
));
}
AssertFatal
(
dl_info
->
rx_ind
!=
NULL
,
"%s: Out of memory in calloc"
,
__FUNCTION__
);
fapi_nr_rx_indication_t
*
rx_ind
=
dl_info
->
rx_ind
;
rx_ind
->
sfn
=
tx_data_request
->
SFN
;
...
...
@@ -469,7 +478,10 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n
uint16_t
num_dci
=
pdu_list
->
pdcch_pdu
.
pdcch_pdu_rel15
.
numDlDci
;
if
(
num_dci
>
0
)
{
dl_info
->
dci_ind
=
CALLOC
(
1
,
sizeof
(
fapi_nr_dci_indication_t
));
if
(
!
dl_info
->
dci_ind
)
{
dl_info
->
dci_ind
=
CALLOC
(
1
,
sizeof
(
fapi_nr_dci_indication_t
));
}
AssertFatal
(
dl_info
->
dci_ind
!=
NULL
,
"%s: Out of memory in calloc"
,
__FUNCTION__
);
dl_info
->
dci_ind
->
SFN
=
ul_dci_req
->
SFN
;
dl_info
->
dci_ind
->
slot
=
ul_dci_req
->
Slot
;
...
...
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