This is a note to let you know that I've just added the patch titled mtd: spi-nor: hisi-sfc: Put child node np on error path to the 5.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mtd-spi-nor-hisi-sfc-put-child-node-np-on-error-path.patch and it can be found in the queue-5.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From fe6653460ee7a7dbe0cd5fd322992af862ce5ab0 Mon Sep 17 00:00:00 2001 From: Pan Bian <bianpan2016@xxxxxxx> Date: Thu, 21 Jan 2021 01:18:47 -0800 Subject: mtd: spi-nor: hisi-sfc: Put child node np on error path From: Pan Bian <bianpan2016@xxxxxxx> commit fe6653460ee7a7dbe0cd5fd322992af862ce5ab0 upstream. Put the child node np when it fails to get or register device. Fixes: e523f11141bd ("mtd: spi-nor: add hisilicon spi-nor flash controller driver") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Pan Bian <bianpan2016@xxxxxxx> [ta: Add Fixes tag and Cc stable] Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20210121091847.85362-1-bianpan2016@xxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/mtd/spi-nor/controllers/hisi-sfc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/mtd/spi-nor/controllers/hisi-sfc.c +++ b/drivers/mtd/spi-nor/controllers/hisi-sfc.c @@ -399,8 +399,10 @@ static int hisi_spi_nor_register_all(str for_each_available_child_of_node(dev->of_node, np) { ret = hisi_spi_nor_register(np, host); - if (ret) + if (ret) { + of_node_put(np); goto fail; + } if (host->num_chip == HIFMC_MAX_CHIP_NUM) { dev_warn(dev, "Flash device number exceeds the maximum chipselect number\n"); Patches currently in stable-queue which might be from bianpan2016@xxxxxxx are queue-5.11/bluetooth-drop-hci-device-reference-before-return.patch queue-5.11/bsg-free-the-request-before-return-error-code.patch queue-5.11/isofs-release-buffer-head-before-return.patch queue-5.11/memory-ti-aemif-drop-child-node-when-jumping-out-loo.patch queue-5.11/mtd-spi-nor-hisi-sfc-put-child-node-np-on-error-path.patch queue-5.11/pci-xilinx-cpm-fix-reference-count-leak-on-error-pat.patch queue-5.11/bluetooth-put-hci-device-if-inquiry-procedure-interr.patch queue-5.11/regulator-s5m8767-fix-reference-count-leak.patch queue-5.11/spi-atmel-put-allocated-master-before-return.patch queue-5.11/fs-affs-release-old-buffer-head-on-error-path.patch queue-5.11/regulator-axp20x-fix-reference-cout-leak.patch