mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init
stable inclusion from stable-v5.10.110 commit a3587259ae553e41d1ce8c7435351a5d6b299a11 bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a3587259ae553e41d1ce8c7435351a5d6b299a11 -------------------------------- [ Upstream commit fecbd4a3 ] 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: f88fc122 ("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.cn Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Yu Liao <liaoyu15@huawei.com> Reviewed-by:
Wei Li <liwei391@huawei.com> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment