Page MenuHomeFreeBSD

gpioc: cleanup if pin allocation fails
ClosedPublic

Authored by vexeduxr on Aug 18 2025, 10:53 AM.
Tags
None
Referenced Files
F156957166: D51998.id160539.diff
Sun, May 17, 3:37 PM
F156957152: D51998.id160539.diff
Sun, May 17, 3:36 PM
F156946173: D51998.id.diff
Sun, May 17, 1:39 PM
Unknown Object (File)
Sun, May 17, 1:48 AM
Unknown Object (File)
Wed, May 13, 7:30 PM
Unknown Object (File)
Mon, Apr 27, 10:54 AM
Unknown Object (File)
Fri, Apr 24, 9:15 PM
Unknown Object (File)
Fri, Apr 24, 8:07 AM
Subscribers

Details

Summary

gpioc normally depends on gpioc_cdevpriv_dtor to call
gpioc_release_pin_intr when it's done with a pin. However, if
gpioc_allocate_pin_intr fails, the pin is never added to the linked list
which the destructor loops over to free the pins. Make it so
gpioc_allocate_pin_intr cleans up after itself if it fails.

Reported by: Evgenii Ivanov <devivanov@proton.me>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable