Thread (35 messages) 35 messages, 6 authors, 5d ago

Re: [PATCH v11 1/7] firmware: smccc: Add an Arm SMCCC bus

From: Jonathan Cameron <hidden>
Date: 2026-09-23 16:43:40
Also in: linux-coco, lkml

On Tue, 15 Sep 2026 08:46:01 -0300
Jason Gunthorpe [off-list ref] wrote:
On Tue, Sep 15, 2026 at 02:52:14PM +0530, Aneesh Kumar K.V wrote:
quoted
quoted
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
Agreed.
Jason
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help