On Thu, Dec 15, 2016 at 1:19 PM, Mark Brown <broonie@xxxxxxxxxx> wrote: > On Thu, Dec 15, 2016 at 12:28:56PM +0100, Axel Haslam wrote: > >> + ret = devm_request_threaded_irq(&pdev->dev, >> + gpiod_to_irq(drvdata->oc_gpio), NULL, >> + reg_fixed_overcurrent_irq, irqflags, >> + "over_current", drvdata); > >> drvdata->dev = devm_regulator_register(&pdev->dev, &drvdata->desc, >> &cfg); > > We are registering a managed interrupt for the interrupt handler and we > are registering it before we register the regulator. This means that > the interrupt may fire in both probe and remove paths without the > regulator which it will then try to use in the interrupt handler, > potentially crashing the system. It's better to register the interrupt > after the regulator (which will make the managed bit OK) to avoid this > possibility. will fix, and send v4. Regards, Axel. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html