Skip to content

Commit abea14b

Browse files
hiss2018bbrezillon
authored andcommitted
i3c: master: Fix error return in cdns_i3c_master_probe()
Fix to return negative error code -ENOMEM from the error handling case instead of 0. Fixes: 603f2be ("i3c: master: Add driver for Cadence IP") Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-i3c/20200911033350.23904-1-jingxiangfeng@huawei.com
1 parent cc3a392 commit abea14b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/i3c/master/i3c-master-cdns.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,8 +1635,10 @@ static int cdns_i3c_master_probe(struct platform_device *pdev)
16351635
master->ibi.slots = devm_kcalloc(&pdev->dev, master->ibi.num_slots,
16361636
sizeof(*master->ibi.slots),
16371637
GFP_KERNEL);
1638-
if (!master->ibi.slots)
1638+
if (!master->ibi.slots) {
1639+
ret = -ENOMEM;
16391640
goto err_disable_sysclk;
1641+
}
16401642

16411643
writel(IBIR_THR(1), master->regs + CMD_IBI_THR_CTRL);
16421644
writel(MST_INT_IBIR_THR, master->regs + MST_IER);

0 commit comments

Comments
 (0)