mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
lanplus: Cleanup. Refix 6dec83ff, fix be2c0c4b
This is a cleanup commit. Commit 6dec83ff removed assignment of `rsp` pointer in SOL-processing block of ipmi_lan_poll_single(), but left the check for the pointer validity in place. Although that has effectively fixed the bug of potentially accessing the null `rsp` pointer in the `else` block introduced with be2c0c4b, the resulting if/else looked suspicious and left and impression that a NULL pointer could still be accessed. This commit removes the check for `rsp` from the `if` as it is checked at the start of the function where `rsp` is initialized (and that is the only place where it is ever changed). Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
parent
5183b2c288
commit
64727f59c4
@ -844,7 +844,7 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
|
|||||||
}
|
}
|
||||||
read_sol_packet(rsp, &offset);
|
read_sol_packet(rsp, &offset);
|
||||||
extra_data_length = payload_size - (offset - payload_start);
|
extra_data_length = payload_size - (offset - payload_start);
|
||||||
if (rsp && extra_data_length) {
|
if (extra_data_length) {
|
||||||
rsp->data_len = extra_data_length;
|
rsp->data_len = extra_data_length;
|
||||||
memmove(rsp->data, rsp->data + offset, extra_data_length);
|
memmove(rsp->data, rsp->data + offset, extra_data_length);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user