Re: [PATCH v2 01/10] firmware: raspberrypi: Introduce rpi_firmware_put()

2020-10-26 Thread Nicolas Saenz Julienne
On Thu, 2020-10-22 at 21:46 +0300, Andy Shevchenko wrote: > On Thu, Oct 22, 2020 at 9:06 PM Nicolas Saenz Julienne > wrote: > > When unbinding the firmware device we need to make sure it has no > > consumers left. Otherwise we'd leave them with a firmware handle > > pointing at freed memory. > >

Re: [PATCH v2 01/10] firmware: raspberrypi: Introduce rpi_firmware_put()

2020-10-22 Thread Andy Shevchenko
On Thu, Oct 22, 2020 at 9:06 PM Nicolas Saenz Julienne wrote: > > When unbinding the firmware device we need to make sure it has no > consumers left. Otherwise we'd leave them with a firmware handle > pointing at freed memory. > > Keep a reference count of all consumers and make sure they all

[PATCH v2 01/10] firmware: raspberrypi: Introduce rpi_firmware_put()

2020-10-22 Thread Nicolas Saenz Julienne
When unbinding the firmware device we need to make sure it has no consumers left. Otherwise we'd leave them with a firmware handle pointing at freed memory. Keep a reference count of all consumers and make sure they all finished unbinding before we do. Suggested-by: Uwe Kleine-König