Commit 6c7860aa authored by Dan Carpenter's avatar Dan Carpenter Committed by Miquel Raynal
Browse files

mtd: spi-nor: hisi-sfc: fix refcounting bug in hisi_spi_nor_register_all()



This was converted to a _scoped() loop but this of_node_put() was
accidentally left behind which is a double free.

Fixes: aa8cb72c ("mtd: spi-nor: hisi-sfc: Simplify with scoped for each OF child loop")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarPratyush Yadav <pratyush@kernel.org>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent e82269e7
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -403,7 +403,6 @@ static int hisi_spi_nor_register_all(struct hifmc_host *host)

		if (host->num_chip == HIFMC_MAX_CHIP_NUM) {
			dev_warn(dev, "Flash device number exceeds the maximum chipselect number\n");
			of_node_put(np);
			break;
		}
	}