[PATCH v11 1/7] firmware: smccc: Add an Arm SMCCC bus
Jason Gunthorpe
jgg at nvidia.com
Tue Sep 15 04:46:01 PDT 2026
On Tue, Sep 15, 2026 at 02:52:14PM +0530, Aneesh Kumar K.V wrote:
> > Yes, but as written it is OK, and this is a common pattern in the
> > kernel. I agree it is fragile tricky..
> >
> > Still it isn't an urgent reason to change it around, but the best
> > pattern is to put the allocate, dev.release=, and device_initialize()
> > in one 'alloc' function. Then the other function calls it and always
> > unwinds with put_device. Use device_add().
> >
> > This avoids mixing the different kfree/put_device error unwind regimes
> > into the same function..
> >
>
> Something like
Yeah, this is the safest way I know to use these interfaces
Jason
More information about the linux-arm-kernel
mailing list