Message ID | 20210617133229.1497-1-angkery@163.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | dmaengine: mediatek: Return the correct errno code | expand |
On 17/06/2021 15:32, angkery wrote: > From: Junlin Yang <yangjunlin@yulong.com> > > When devm_kzalloc failed, should return ENOMEM rather than ENODEV. > > Signed-off-by: Junlin Yang <yangjunlin@yulong.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> > --- > drivers/dma/mediatek/mtk-uart-apdma.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/dma/mediatek/mtk-uart-apdma.c b/drivers/dma/mediatek/mtk-uart-apdma.c > index 375e7e6..a4cb30f 100644 > --- a/drivers/dma/mediatek/mtk-uart-apdma.c > +++ b/drivers/dma/mediatek/mtk-uart-apdma.c > @@ -529,7 +529,7 @@ static int mtk_uart_apdma_probe(struct platform_device *pdev) > for (i = 0; i < mtkd->dma_requests; i++) { > c = devm_kzalloc(mtkd->ddev.dev, sizeof(*c), GFP_KERNEL); > if (!c) { > - rc = -ENODEV; > + rc = -ENOMEM; > goto err_no_dma; > } > >
On Thu, Jun 17, 2021 at 9:35 PM angkery <angkery@163.com> wrote: > > From: Junlin Yang <yangjunlin@yulong.com> > > When devm_kzalloc failed, should return ENOMEM rather than ENODEV. > > Signed-off-by: Junlin Yang <yangjunlin@yulong.com> Please add proper fixes tags: Fixes: 9135408c3ace ("dmaengine: mediatek: Add MediaTek UART APDMA support")
diff --git a/drivers/dma/mediatek/mtk-uart-apdma.c b/drivers/dma/mediatek/mtk-uart-apdma.c index 375e7e6..a4cb30f 100644 --- a/drivers/dma/mediatek/mtk-uart-apdma.c +++ b/drivers/dma/mediatek/mtk-uart-apdma.c @@ -529,7 +529,7 @@ static int mtk_uart_apdma_probe(struct platform_device *pdev) for (i = 0; i < mtkd->dma_requests; i++) { c = devm_kzalloc(mtkd->ddev.dev, sizeof(*c), GFP_KERNEL); if (!c) { - rc = -ENODEV; + rc = -ENOMEM; goto err_no_dma; }