In the Linux kernel, the following vulnerability has been resolved: power: supply: bq27xxx: Fix pollinterval handling and races on remove Before this patch bq27xxxbatteryteardown() was setting pollinterval = 0 to avoid bq27xxxbatteryupdate() requeuing the delayedwork item. There are 2 problems with this: 1. If the driver is unbound through sysfs, rather then the module being rmmod-ed, this changes pollinterval unexpectedly 2. This is racy, after it being set pollinterval could be changed before bq27xxxbatteryupdate() checks it through /sys/module/bq27xxxbattery/parameters/pollinterval Fix this by added a removed attribute to struct bq27xxxdeviceinfo and using that instead of setting pollinterval to 0. There also is another pollinterval related race on remove(), writing /sys/module/bq27xxxbattery/parameters/pollinterval will requeue the delayedwork item for all devices on the bq27xxxbatterydevices list and the device being removed was only removed from that list after cancelling the delayedwork item. Fix this by moving the removal from the bq27xxxbatterydevices list to before cancelling the delayedwork item.