gpiolib: add reference counting to GPIO descriptors
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 14 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | gpiolib: provide VALIDATE_DESC_PTR() macrodrivers/ | +8 | 0 replies | |
| 2/3 | gpiolib: use kref in gpio_descdrivers/ drivers/ include/ | +46 | 14 replies | |
| 3/3 | nvmem: increase the reference count of a gpio passed over configdrivers/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] gpiolib: add reference counting to GPIO descriptors
From: Bartosz Golaszewski <[email protected]>
This was: nvmem/gpio: fix resource management.
These are the remaining patches from the series aimed at fixing resource management problems in nvmem.
The first one adds a new descriptor validation macro. The second uses kref to add reference counting to GPIO descriptors. The last one fixes a potential use-after-free problem in nvmem.
The last change should actually go into v5.6 but it depends on a new feature. I'm not sure how to go about applying this.
Changes in patch 2/3 since the last submission:
- add a stub for when GPIOLIB is not selected
- use might_sleep() in gpiod_put() as we may not necessarily call gpiod_free() every time now (where it would have been called normally) depending on the reference count
Bartosz Golaszewski (3):
gpiolib: provide VALIDATE_DESC_PTR() macro
gpiolib: use kref in gpio_desc
nvmem: increase the reference count of a gpio passed over config
drivers/gpio/gpiolib.c | 48 ++++++++++++++++++++++++++++++++--- drivers/gpio/gpiolib.h | 1 + drivers/nvmem/core.c | 2 +- include/linux/gpio/consumer.h | 9 +++++++ 4 files changed, 55 insertions(+), 5 deletions(-)
Signature · 1 line
2.25.0