Home
last modified time | relevance | path

Searched hist:"4 ce535ec" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/base/
H A Dnode.c4ce535ec Fri Apr 09 06:01:57 CDT 2021 Dan Carpenter <dan.carpenter@oracle.com> node: fix device cleanups in error handling code

We can't use kfree() to free device managed resources so the kfree(dev)
is against the rules.

It's easier to write this code if we open code the device_register() as
a device_initialize() and device_add(). That way if dev_set_name() set
name fails we can call put_device() and it will clean up correctly.

Fixes: acc02a109b04 ("node: Add memory-side caching attributes")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YHA0JUra+F64+NpB@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>