mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
hinic3: handle auxiliary device ID allocation failure
hinic3_init_hwdev() stores the result of hinic3_adev_idx_alloc() in hwdev->dev_id without checking for an error. If ID allocation fails but the remaining initialization succeeds, hinic3_add_one_adev() uses the negative error code as the auxiliary device ID instead of a reserved ID. Return the allocation error before initializing the hardware. Add an unwind label that clears pci_adapter->hwdev and frees the allocation without attempting to release an ID that was never allocated. Cc: stable+noautosel@kernel.org # untested fix to unlikely driver error path Reported-by: Changyul Lee <lcy8047@gmail.com> Signed-off-by: Sang-Hoon Choi <csh0052@gmail.com> Link: https://patch.msgid.link/179001656835.91284.3719235813225229273.idr-bug-81@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
22b9a9e5e2
commit
087827628a
1 changed files with 6 additions and 1 deletions
Loading…
Add table
Add a link
Reference in a new issue