Commit 8215794
be2net: Fix NULL pointer dereference in be_cmd_get_mac_from_list
When the parameter pmac_id_valid argument of be_cmd_get_mac_from_list() is
set to false, the driver may request the PMAC_ID from the firmware of the
network card, and this function will store that PMAC_ID at the provided
address pmac_id. This is the contract of this function.
However, there is a location within the driver where both
pmac_id_valid == false and pmac_id == NULL are being passed. This could
result in dereferencing a NULL pointer.
To resolve this issue, it is necessary to pass the address of a stub
variable to the function.
Fixes: 95046b9 ("be2net: refactor MAC-addr setup code")
Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
Link: https://patch.msgid.link/20260120113734.20193-1-a.vatoropin@crpt.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 2030c43 commit 8215794
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3801 | 3801 | | |
3802 | 3802 | | |
3803 | 3803 | | |
| 3804 | + | |
3804 | 3805 | | |
3805 | 3806 | | |
3806 | 3807 | | |
| |||
3813 | 3814 | | |
3814 | 3815 | | |
3815 | 3816 | | |
3816 | | - | |
| 3817 | + | |
3817 | 3818 | | |
3818 | 3819 | | |
3819 | 3820 | | |
| |||
0 commit comments