Re: [PATCH 1/1] dma: bcm6348: incorrect buffer allocation

2021-01-19 Thread Tom Rini
On Sun, Dec 27, 2020 at 10:26:00AM +0100, Heinrich Schuchardt wrote: > 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(). >

Re: [PATCH 1/1] dma: bcm6348: incorrect buffer allocation

2020-12-27 Thread Heinrich Schuchardt
On 12/27/20 11:18 AM, Álvaro Fernández Rojas wrote: Hello Heinrich, This is not swapped. busy_desc is only used in RX. Please, check the rest of the driver: https://github.com/u-boot/u-boot/blob/master/drivers/dma/bcm6348-iudma.c Regards, Álvaro. Thanks for reviewing. Why is calloc called wit

Re: [PATCH 1/1] dma: bcm6348: incorrect buffer allocation

2020-12-27 Thread Álvaro Fernández Rojas
Hello Heinrich, This is not swapped. busy_desc is only used in RX. Please, check the rest of the driver: https://github.com/u-boot/u-boot/blob/master/drivers/dma/bcm6348-iudma.c Regards, Álvaro. El 27/12/2020 a las 10:26, Heinrich Schuchardt escribió: Calling calloc() for 0 members does not ma

[PATCH 1/1] dma: bcm6348: incorrect buffer allocation

2020-12-27 Thread Heinrich Schuchardt
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: He