]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
powerpc/papr_scm: Fix leaking 'bus_desc.provider_name' in some paths
authorVaibhav Jain <vaibhav@linux.ibm.com>
Wed, 22 Jan 2020 15:51:40 +0000 (21:21 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 25 Jan 2020 13:11:37 +0000 (00:11 +1100)
commit5649607a8d0b0e019a4db14aab3de1e16c3a2b4f
tree980049d0581f6131d9cb049da60ba44067f87f95
parent493a55f1e7724dee5e71bc726d5b819292094587
powerpc/papr_scm: Fix leaking 'bus_desc.provider_name' in some paths

String 'bus_desc.provider_name' allocated inside
papr_scm_nvdimm_init() will leaks in case call to
nvdimm_bus_register() fails or when papr_scm_remove() is called.

This minor patch ensures that 'bus_desc.provider_name' is freed in
error path for nvdimm_bus_register() as well as in papr_scm_remove().

Fixes: b5beae5e224f ("powerpc/pseries: Add driver for PAPR SCM regions")
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200122155140.120429-1-vaibhav@linux.ibm.com
arch/powerpc/platforms/pseries/papr_scm.c