dma: bcm6348: incorrect buffer allocation
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 27 Dec 2020 09:26:00 +0000 (10:26 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 18 Jan 2021 20:23:06 +0000 (15:23 -0500)
commit4908067b8f87ebaa9a26514dfe5a9ffba13deb2c
tree39741bbaf08f42eb20e30b81f44be02058295864
parent9e9a530a61c01e412a239d8c211d5b1e26b578fa
dma: bcm6348: incorrect buffer allocation

Calling calloc() for 0 members does not make any sense.
Setting ch_priv->busy_desc = NULL for ch_priv->desc_cnt > 0 is equally
unreasonable.

The current code will lead to a NULL dereference in bcm6348_iudma_enable().

The assignments for ch_priv->busy_desc are obviously swapped.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
drivers/dma/bcm6348-iudma.c