]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gpio: aggregator: lock device when calling device_is_bound()
authorBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Mon, 18 May 2026 09:53:18 +0000 (11:53 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Thu, 21 May 2026 12:36:06 +0000 (14:36 +0200)
The kerneldoc for device_is_bound() says it must be called with the
device lock taken. Add missing synchronization to this driver.

Fixes: 3a27f40b4570 ("gpio: aggregator: stop using dev-sync-probe")
Link: https://patch.msgid.link/20260518-gpio-dev-lock-v1-2-cc4736f3ff0b@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-aggregator.c

index a9ad809708fb66587d171699293ac2430e478512..bc6699a821ee789f2f954a56500084e064a23b85 100644 (file)
@@ -968,9 +968,12 @@ static int gpio_aggregator_activate(struct gpio_aggregator *aggr)
        }
 
        wait_for_device_probe();
-       if (!device_is_bound(&pdev->dev)) {
-               ret = -ENXIO;
-               goto err_unregister_pdev;
+
+       scoped_guard(device, &pdev->dev) {
+               if (!device_is_bound(&pdev->dev)) {
+                       ret = -ENXIO;
+                       goto err_unregister_pdev;
+               }
        }
 
        aggr->pdev = pdev;