summaryrefslogtreecommitdiffstats
path: root/include/linux/udp.h
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2023-03-09 08:45:46 +0100
committerWolfram Sang <wsa@kernel.org>2023-03-09 22:07:52 +0100
commit9e5f81f9a6e78ba411117146ecf324d0145ae89a (patch)
tree1f74cbcae85b490199486de4f584077f0f039342 /include/linux/udp.h
parent834a9dc46db796f662615a18b8a38dde73f3b804 (diff)
downloadlinux-9e5f81f9a6e78ba411117146ecf324d0145ae89a.tar.gz
linux-9e5f81f9a6e78ba411117146ecf324d0145ae89a.tar.bz2
linux-9e5f81f9a6e78ba411117146ecf324d0145ae89a.zip
i2c: dev: Fix bus callback return values
The i2cdev_{at,de}tach_adapter() callbacks are used for two purposes: 1. As notifier callbacks, when (un)registering I2C adapters created or destroyed after i2c_dev_init(), 2. As bus iterator callbacks, for registering already existing adapters from i2c_dev_init(), and for cleanup. Unfortunately both use cases expect different return values: the former expects NOTIFY_* return codes, while the latter expects zero or error codes, and aborts in case of error. Hence in case 2, as soon as i2cdev_{at,de}tach_adapter() returns (non-zero) NOTIFY_OK, the bus iterator aborts. This causes (a) only the first already existing adapter to be registered, leading to missing /dev/i2c-* entries, and (b) a failure to unregister all but the first I2C adapter during cleanup. Fix this by introducing separate callbacks for the bus iterator, wrapping the notifier functions, and always returning succes. Any errors inside these callback functions are unlikely to happen, and are fatal anyway. Fixes: cddf70d0bce71c2a ("i2c: dev: fix notifier return values") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'include/linux/udp.h')
0 files changed, 0 insertions, 0 deletions