• Vignesh Raghavendra's avatar
    dmaengine: ti: k3-udma: Fix smatch warnings · 80936d68
    Vignesh Raghavendra authored
    Smatch reports below warnings [1] wrt dereferencing rm_res when it can
    potentially be ERR_PTR(). This is possible when entire range is
    allocated to Linux
    Fix this case by making sure, there is no deference of rm_res when its
    ERR_PTR().
    
    [1]:
     drivers/dma/ti/k3-udma.c:4524 udma_setup_resources() error: 'rm_res' dereferencing possible ERR_PTR()
     drivers/dma/ti/k3-udma.c:4537 udma_setup_resources() error: 'rm_res' dereferencing possible ERR_PTR()
     drivers/dma/ti/k3-udma.c:4681 bcdma_setup_resources() error: 'rm_res' dereferencing possible ERR_PTR()
     drivers/dma/ti/k3-udma.c:4696 bcdma_setup_resources() error: 'rm_res' dereferencing possible ERR_PTR()
     drivers/dma/ti/k3-udma.c:4711 bcdma_setup_resources() error: 'rm_res' dereferencing possible ERR_PTR()
     drivers/dma/ti/k3-udma.c:4848 pktdma_setup_resources() error: 'rm_res' dereferencing possible ERR_PTR()
     drivers/dma/ti/k3-udma.c:4861 pktdma_setup_resources() error: 'rm_res' dereferencing possible ERR_PTR()
    Reported-by: default avatarNishanth Menon <nm@ti.com>
    Signed-off-by: default avatarVignesh Raghavendra <vigneshr@ti.com>
    Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@gmail.com>
    Link: https://lore.kernel.org/r/20211209180957.29036-1-vigneshr@ti.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    80936d68
k3-udma.c 140 KB