Messages in this thread | | | Date | Thu, 16 Jun 2022 21:32:51 +0200 | From | Wolfram Sang <> | Subject | Re: [PATCH] i2c: core: fix potential use-after-free on adapter removal |
| |
Hi Michał,
> I looked briefly at the kobject machinery and it seems to ignore module > dependencies. So while both approaches might work, I'd usually reverse
Thanks for checking!
> the order the init code is using: in this case module_get+device_get, > so on release: device_put+module_put. I don't know what keeps the kernel
I agree this is good style. I'll add a comment why we reverse the order. This will be also good to avoid regressions.
> from unloading the module after module_put() and before the function > returns, but I assume that would blow up for both patches.
Yes. There are other users in the kernel doing it like this (RTC and regmap IIRC), so I think problems would have become visible by then.
Thank you for your help!
Wolfram
[unhandled content-type:application/pgp-signature] | |