diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-04-09 14:01:57 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-10 12:10:21 +0300 |
commit | 4ce535ec0084f0d712317cb99d383cad3288e713 (patch) | |
tree | 95156c8b8fdb08224acfdbec7518fa4433a7ddc9 /drivers/of | |
parent | b4104180a2efb85f55e1ba1407885c9421970338 (diff) | |
download | linux-4ce535ec0084f0d712317cb99d383cad3288e713.tar.xz |
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>
Diffstat (limited to 'drivers/of')
0 files changed, 0 insertions, 0 deletions