diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 69cfb05e4d3ceb1361a060d0d5b0dcda8b218d84..b3b3180ce561c1073210db69dba4227c124e2b52 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -1332,9 +1332,10 @@ static int pl08x_prep_channel_resources(struct pl08x_dma_chan *plchan, int ret; num_llis = pl08x_fill_llis_for_desc(pl08x, txd); - - if (!num_llis) + if (!num_llis) { + kfree(txd); return -EINVAL; + } spin_lock_irqsave(&plchan->lock, plchan->lockflags);