Hi David, > This is the same as my previous patchset but split into sequential patches. The > first patch makes the destruct-cb optional so the patches 2-7 can remove the > empty callbacks. > Patches 8-14 make the remaining drivers drop the destruct-callback and directly > free the driver data. > Patches 15-18 then remove the (now unused!) destruct callback and then properly > fixes the reference counts (same patches as already posted). > > I hope the first 14 patches make clear that half of our drivers already work > without the destruct callback and the other half can be safely converted into > not using it. In fact, the drivers that use it introduce some memleaks which are > fixed by simply dropping the callback and freeing everything right away. > > I've added detailed commit messages to each driver. If a single step is unclear, > please point me to it. > > > By the way, this fixes several bugs we currently have, including some mem-leaks > as described in the commits and the fact that hci_free_dev() currently > *directly* destroys the hci object regardless of any previous calls to > hci_hold_dev/hci_put_dev(). This is because the hci->refcnt counter is in no way > linked to the lifetime of the hci object. See hci_sysfs the release_host > callback which actually frees the hci object. It is in no way triggered by > hci->refcnt. > This patchset fixes all this and introduces proper reference counting. I went through the patches again and after thinking about it for a bit, this all looks good. Acked-by: Marcel Holtmann <marcel@xxxxxxxxxxxx> Johan, feel free to include this patchset into your tree. Regards Marcel -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html