]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
usb: typec: tcpci: Fix wakeup source leaks on device unbind
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 6 Apr 2025 20:40:50 +0000 (22:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Apr 2025 14:08:32 +0000 (16:08 +0200)
Device can be unbound, so driver must also release memory for the wakeup
source.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20250406204051.63446-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpci_maxim_core.c

index fd1b80593367641a6f997da2fb97a2b7238f6982..29a4aa89d1a143927763c77303a7fe524b7df124 100644 (file)
@@ -536,7 +536,10 @@ static int max_tcpci_probe(struct i2c_client *client)
                return dev_err_probe(&client->dev, ret,
                                     "IRQ initialization failed\n");
 
-       device_init_wakeup(chip->dev, true);
+       ret = devm_device_init_wakeup(chip->dev);
+       if (ret)
+               return dev_err_probe(chip->dev, ret, "Failed to init wakeup\n");
+
        return 0;
 }