On Thu, May 21, 2020 at 09:58:57PM +0100, Ben Hutchings wrote:
On Thu, 2020-05-21 at 07:50 +0200, Greg Kroah-Hartman wrote:
On Wed, May 20, 2020 at 08:45:15PM +0100, Ben Hutchings wrote:
Please pick this fix for all stable branches:
commit 1413ef638abae4ab5621901cf4d8ef08a4a48ba6 Author: Kevin Hao haokexin@gmail.com Date: Fri Oct 11 23:00:14 2019 +0800
i2c: dev: Fix the race between the release of i2c_dev and cdev
I don't know whether it will apply cleanly to all of them; I can deal with those where it doesn't.
I applied it to 4.14, 4.19, 5.4, and 5.6. It does apply to 4.9 but as the patch it depends on is not there, I don't think it will help.
It was included in 4.9.224, so both this and the similar watchdog fix should be applicable for 4.9.
I took it for 4.9, haven't noticed any issues.
I don't think it applies to 4.4 though as we don't have:
d6760b14d4a1 ("i2c: dev: switch from register_chrdev to cdev API")
I did notice 3 other commits which I've taken in:
5136ed4fcb05 ("i2c-dev: don't get i2c adapter via i2c_dev") e6be18f6d62c ("i2c: dev: use after free in detach") 72a71f869c95 ("i2c: dev: don't start function name with 'return'")