Hi, On 12/8/22 16:19, Yang Yingliang wrote: > In some error paths before device_register(), the names allocated > by dev_set_name() are not freed. Move dev_set_name() front to > device_register(), so the name can be freed while calling > put_device(). > > Fixes: 54b34aa0a729 ("platform/x86: intel_scu_ipc: Split out SCU IPC functionality from the SCU driver") > Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx> Thank you for your patch, I've applied this patch to my review-hans branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while. Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window. Regards, Hans > --- > drivers/platform/x86/intel_scu_ipc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c > index 7cc9089d1e14..e7a3e3402817 100644 > --- a/drivers/platform/x86/intel_scu_ipc.c > +++ b/drivers/platform/x86/intel_scu_ipc.c > @@ -583,7 +583,6 @@ __intel_scu_ipc_register(struct device *parent, > scu->dev.parent = parent; > scu->dev.class = &intel_scu_ipc_class; > scu->dev.release = intel_scu_ipc_release; > - dev_set_name(&scu->dev, "intel_scu_ipc"); > > if (!request_mem_region(scu_data->mem.start, resource_size(&scu_data->mem), > "intel_scu_ipc")) { > @@ -612,6 +611,7 @@ __intel_scu_ipc_register(struct device *parent, > * After this point intel_scu_ipc_release() takes care of > * releasing the SCU IPC resources once refcount drops to zero. > */ > + dev_set_name(&scu->dev, "intel_scu_ipc"); > err = device_register(&scu->dev); > if (err) { > put_device(&scu->dev);