Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'riscv-soc-fixes-for-v7.0-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into arm/fixes

RISC-V soc fixes for v7.0-rc1

drivers:
Fix leaks in probe/init function teardown code in three drivers.

microchip:
Fix a warning introduced by a recent binding change, that made resets
required on Polarfire SoC's CAN IP.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>

* tag 'riscv-soc-fixes-for-v7.0-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux:
cache: ax45mp: Fix device node reference leak in ax45mp_cache_init()
cache: starfive: fix device node leak in starlink_cache_init()
riscv: dts: microchip: add can resets to mpfs
soc: microchip: mpfs: Fix memory leak in mpfs_sys_controller_probe()

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+15 -8
+2
arch/riscv/boot/dts/microchip/mpfs.dtsi
··· 428 428 clocks = <&clkcfg CLK_CAN0>, <&clkcfg CLK_MSSPLL3>; 429 429 interrupt-parent = <&plic>; 430 430 interrupts = <56>; 431 + resets = <&mss_top_sysreg CLK_CAN0>; 431 432 status = "disabled"; 432 433 }; 433 434 ··· 438 437 clocks = <&clkcfg CLK_CAN1>, <&clkcfg CLK_MSSPLL3>; 439 438 interrupt-parent = <&plic>; 440 439 interrupts = <57>; 440 + resets = <&mss_top_sysreg CLK_CAN1>; 441 441 status = "disabled"; 442 442 }; 443 443
+2 -2
drivers/cache/ax45mp_cache.c
··· 178 178 179 179 static int __init ax45mp_cache_init(void) 180 180 { 181 - struct device_node *np; 182 181 struct resource res; 183 182 int ret; 184 183 185 - np = of_find_matching_node(NULL, ax45mp_cache_ids); 184 + struct device_node *np __free(device_node) = 185 + of_find_matching_node(NULL, ax45mp_cache_ids); 186 186 if (!of_device_is_available(np)) 187 187 return -ENODEV; 188 188
+9 -4
drivers/soc/microchip/mpfs-sys-controller.c
··· 142 142 143 143 sys_controller->flash = of_get_mtd_device_by_node(np); 144 144 of_node_put(np); 145 - if (IS_ERR(sys_controller->flash)) 146 - return dev_err_probe(dev, PTR_ERR(sys_controller->flash), "Failed to get flash\n"); 145 + if (IS_ERR(sys_controller->flash)) { 146 + ret = dev_err_probe(dev, PTR_ERR(sys_controller->flash), "Failed to get flash\n"); 147 + goto out_free; 148 + } 147 149 148 150 no_flash: 149 151 sys_controller->client.dev = dev; ··· 157 155 if (IS_ERR(sys_controller->chan)) { 158 156 ret = dev_err_probe(dev, PTR_ERR(sys_controller->chan), 159 157 "Failed to get mbox channel\n"); 160 - kfree(sys_controller); 161 - return ret; 158 + goto out_free; 162 159 } 163 160 164 161 init_completion(&sys_controller->c); ··· 175 174 dev_info(&pdev->dev, "Registered MPFS system controller\n"); 176 175 177 176 return 0; 177 + 178 + out_free: 179 + kfree(sys_controller); 180 + return ret; 178 181 } 179 182 180 183 static void mpfs_sys_controller_remove(struct platform_device *pdev)