Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zephyr Firmware
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kestrel Collaboration
Kestrel Firmware
Zephyr Firmware
Commits
a497387f
Commit
a497387f
authored
Jul 23, 2021
by
Raptor Engineering Development Team
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly handle potential buffer malloc() failure in HIOMAP write window request
parent
ef7fc2b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
kestrel/src/ipmi_bt.h
kestrel/src/ipmi_bt.h
+1
-0
kestrel/src/kestrel.c
kestrel/src/kestrel.c
+7
-0
No files found.
kestrel/src/ipmi_bt.h
View file @
a497387f
...
...
@@ -72,6 +72,7 @@
#define IPMI_CC_NO_ERROR 0x00
#define IPMI_CC_SNS_NOT_PRSNT 0xcb
#define IPMI_CC_INVALID_COMMAND 0xc1
#define IPMI_CC_OUT_OF_SPACE 0xc4
#define BASE_IPMI_REQUEST_LENGTH 3
#define BASE_IPMI_RESPONSE_LENGTH 4
...
...
kestrel/src/kestrel.c
View file @
a497387f
...
...
@@ -1544,6 +1544,13 @@ static int process_host_to_bmc_ipmi_bt_transactions(void)
hiomap_config
.
write_windows
[
hiomap_config
.
write_window_count
].
start_address
=
hiomap_config
.
window_start_address
;
hiomap_config
.
write_windows
[
hiomap_config
.
write_window_count
].
bytes
=
hiomap_config
.
window_length_bytes
;
hiomap_config
.
write_windows
[
hiomap_config
.
write_window_count
].
buffer
=
malloc
(
FLASH_MAX_WR_WINDOW_BYTES
);
if
(
hiomap_config
.
write_windows
[
hiomap_config
.
write_window_count
].
buffer
==
NULL
)
{
KESTREL_LOG
(
"[ERROR] Unable to allocate HIOMAP buffer space!
\n
"
);
response
.
length
=
BASE_IPMI_RESPONSE_LENGTH
;
response
.
completion_code
=
IPMI_CC_OUT_OF_SPACE
;
break
;
}
hiomap_config
.
write_windows
[
hiomap_config
.
write_window_count
].
active
=
1
;
hiomap_write_buffer
=
hiomap_config
.
write_windows
[
hiomap_config
.
write_window_count
].
buffer
;
hiomap_config
.
write_window_count
++
;
...
...
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