Messages in this thread | | | From | Miquel Raynal <> | Subject | Re: [PATCH v4] mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init | Date | Mon, 14 Mar 2022 17:00:00 +0100 |
| |
On Fri, 2022-03-04 at 08:53:32 UTC, Xin Xiong wrote: > 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: f88fc122cc34 ("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>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
Miquel
| |