summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/kvec/errors.rs
diff options
context:
space:
mode:
authorShawn Guo <shengchao.guo@oss.qualcomm.com>2026-10-28 20:34:46 +0800
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-11-02 10:44:38 +0100
commit53b7b1201964f6f147fa0fa2f61194403a65cdf0 (patch)
treeaf68b7e3d68c6e9472d1b9936533b105ee246e22 /rust/kernel/alloc/kvec/errors.rs
parenteb70d2419e79b6720fd465b905a2dddd751f2a48 (diff)
gpio: shared-proxy: Drop the vote of a released proxy on write failure
When a proxy that voted for a value change frees the line, it calls gpio_shared_proxy_set_unlocked() to withdraw its vote. If it is the last voter and restoring the default value fails, that function returns early, leaving votecnt incremented and voted_change set. The consumer is gone, but its vote is not. The line is held at the non-default value for all remaining users, since votecnt can never drop to zero again. And the proxy data outlives the request, so voted_change is still set when the line is requested again. If another user has reinitialized the line in between, resetting votecnt to 0, the stale proxy's next vote for the default value decrements votecnt from 0 and underflows it. Drop the vote unconditionally on release, after reporting the failure, since the consumer is going away regardless. Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver") Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com> Link: https://patch.msgid.link/20261028123448.510401-3-shengchao.guo@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions