Re: [PATCH 2/2] i2c: Fix a potential use after free

From: Markus Elfring
Date: Sat Dec 28 2019 - 07:50:53 EST


> Free the adap structure only after we are done using it.

This information can be reasonable.


> This patch just moves the put_device() down a bit to avoid the
> use after free.

I suggest to reconsider such a change because a device reference count
should eventually be decremented before decrementing the reference count
for the module which is managed by this programming interface.
Would you like to clarify the dependencies for such an use case any more?

Regards,
Markus