Skip to content

Commit

Permalink
mtd: spi-nor: nxp-spifi: release flash_np in nxp_spifi_probe()
Browse files Browse the repository at this point in the history
nxp_spifi_probe() increments refcnt of SPI flash device node by
of_get_next_available_child() and leaves it undecremented on both
successful and error paths.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
  • Loading branch information
khoroshilov authored and Boris Brezillon committed Jun 21, 2018
1 parent 9882b53 commit 38ebbe2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mtd/spi-nor/nxp-spifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ static int nxp_spifi_probe(struct platform_device *pdev)
}

ret = nxp_spifi_setup_flash(spifi, flash_np);
of_node_put(flash_np);
if (ret) {
dev_err(&pdev->dev, "unable to setup flash chip\n");
goto dis_clks;
Expand Down

0 comments on commit 38ebbe2

Please sign in to comment.