Messages in this thread | | | Subject | Re: gigaset: freeing an active object | From | Tilman Schmidt <> | Date | Mon, 30 Nov 2015 19:30:15 +0100 |
| |
Am 30.11.2015 um 19:01 schrieb Paul Bolle: > [DRAFT] gigaset: don't free() a struct platform_device > > One is not supposed to free() a struct platform_device. Instead one > should, in the common case, only call platform_device_unregister(). That > will drop the platform device's reference count. (Actually it's the > reference count of the embedded kobject that is important here. But for > users of platform devices that's basically irrelevant.) > > So move struct platform_device dev out of struct ser_cardstate, because > ser_cardstate is (malloc'ed and) free'd.
I wonder how that will behave if someone attaches two of the devices to different serial ports. Not likely, but not forbidden either.
Regards, Tilman
-- Tilman Schmidt E-Mail: tilman@imap.cc Bonn, Germany Nous, on a des fleurs et des bougies pour nous protéger.
[unhandled content-type:application/pgp-signature] | |