Commit 615f8f5
mtd: rawnand: loongson1: Fix inconsistent refcounting in ls1x_nand_chip_init()
As reported by Dan,
commit d2d10ed ("mtd: rawnand: Add Loongson-1 NAND Controller
Driver"), leads to the following Smatch static checker warning:
drivers/mtd/nand/raw/loongson1-nand-controller.c:730 ls1x_nand_chip_init()
warn: inconsistent refcounting 'chip_np->kobj.kref.refcount.refs.counter':
Fix this issue by calling of_node_put() immediately after using chip_np.
In addition, remove all unnecessary of_node_put(chip_np) calls.
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aBR535RZZT-sa6QZ@stanley.mountain/
Fixes: d2d10ed ("mtd: rawnand: Add Loongson-1 NAND Controller Driver")
Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>1 parent 0d470c7 commit 615f8f5
1 file changed
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | 706 | | |
| 707 | + | |
711 | 708 | | |
712 | 709 | | |
713 | 710 | | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
714 | 715 | | |
715 | 716 | | |
716 | 717 | | |
717 | 718 | | |
718 | | - | |
719 | | - | |
| 719 | + | |
720 | 720 | | |
721 | | - | |
722 | 721 | | |
723 | 722 | | |
724 | 723 | | |
725 | 724 | | |
726 | | - | |
727 | 725 | | |
728 | 726 | | |
729 | 727 | | |
| |||
0 commit comments