drivers: dma: ti: k3-udma: Extract packet data only when Meta data is not NULL
authorKeerthy <j-keerthy@ti.com>
Wed, 24 Apr 2019 11:03:54 +0000 (16:33 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 3 May 2019 11:23:17 +0000 (07:23 -0400)
Currently packet data is wrongly extracted when metadata is NULL.
Fix it and negate the if check.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
drivers/dma/ti/k3-udma.c

index f78a01aa8f8cd8eec884808601357338205d8c52..e9ca09d8d3296e062ac675e0217f5f3f1f18dd04 100644 (file)
@@ -1492,7 +1492,7 @@ static int udma_send(struct dma *dma, void *src, size_t len, void *metadata)
        u32 tc_ring_id;
        int ret;
 
-       if (!metadata)
+       if (metadata)
                packet_data = *((struct ti_udma_drv_packet_data *)metadata);
 
        if (dma->id >= (ud->rchan_cnt + ud->tchan_cnt)) {