diff options
| author | Yufan Chen <yufan.chen@linux.dev> | 2026-03-29 00:32:57 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-03-31 19:38:36 -0700 |
| commit | c0fd0fe745f5e8c568d898cd1513d0083e46204a (patch) | |
| tree | 8b4774ba7625cd408662dce4ecd516db8712ed6d /drivers/usb/input/git@git.tavy.me:linux.git | |
| parent | 5dd8025a49c268ab6b94d978532af3ad341132a7 (diff) | |
net: ftgmac100: fix ring allocation unwind on open failure
ftgmac100_alloc_rings() allocates rx_skbs, tx_skbs, rxdes, txdes, and
rx_scratch in stages. On intermediate failures it returned -ENOMEM
directly, leaking resources allocated earlier in the function.
Rework the failure path to use staged local unwind labels and free
allocated resources in reverse order before returning -ENOMEM. This
matches common netdev allocation cleanup style.
Fixes: d72e01a0430f ("ftgmac100: Use a scratch buffer for failed RX allocations")
Cc: stable@vger.kernel.org
Signed-off-by: Yufan Chen <yufan.chen@linux.dev>
Link: https://patch.msgid.link/20260328163257.60836-1-yufan.chen@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/usb/input/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
