Commit fecbd4a
mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init
The reference counting issue happens in several error handling paths
on a refcounted object "nc->dmac". In these paths, the function simply
returns the error code, forgetting to balance the reference count of
"nc->dmac", increased earlier by dma_request_channel(), which may
cause refcount leaks.
Fix it by decrementing the refcount of specific object in those error
paths.
Fixes: f88fc12 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Co-developed-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Co-developed-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220304085330.3610-1-xiongx18@fudan.edu.cn1 parent fba6eb4 commit fecbd4a
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2060 | 2060 | | |
2061 | 2061 | | |
2062 | 2062 | | |
2063 | | - | |
| 2063 | + | |
| 2064 | + | |
2064 | 2065 | | |
2065 | 2066 | | |
2066 | 2067 | | |
2067 | 2068 | | |
2068 | 2069 | | |
2069 | | - | |
| 2070 | + | |
| 2071 | + | |
2070 | 2072 | | |
2071 | 2073 | | |
2072 | 2074 | | |
2073 | 2075 | | |
2074 | 2076 | | |
2075 | 2077 | | |
2076 | 2078 | | |
2077 | | - | |
| 2079 | + | |
2078 | 2080 | | |
2079 | 2081 | | |
2080 | 2082 | | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
2081 | 2089 | | |
2082 | 2090 | | |
2083 | 2091 | | |
| |||
0 commit comments