diff mbox

[2/2,net-next] mediatek: unlock on error in mtk_tx_map()

Message ID 20160315071904.GI13560@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter March 15, 2016, 7:19 a.m. UTC
There was a missing unlock on the error path.

Fixes: 656e705243fd ('net-next: mediatek: add support for MT7623 ethernet')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

John Crispin March 15, 2016, 7:27 a.m. UTC | #1
On 15/03/2016 08:19, Dan Carpenter wrote:
> There was a missing unlock on the error path.
> 
> Fixes: 656e705243fd ('net-next: mediatek: add support for MT7623 ethernet')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 

Acked-by: John Crispin <blogic@openwrt.org>

Thanks !

> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index 9759fe5..c2c2e206 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -661,6 +661,8 @@ err_dma:
>  		itxd = mtk_qdma_phys_to_virt(ring, itxd->txd2);
>  	} while (itxd != txd);
>  
> +	spin_unlock_irqrestore(&eth->page_lock, flags);
> +
>  	return -ENOMEM;
>  }
>  
> 
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
>
David Miller March 18, 2016, 10:31 p.m. UTC | #2
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 15 Mar 2016 10:19:04 +0300

> There was a missing unlock on the error path.
> 
> Fixes: 656e705243fd ('net-next: mediatek: add support for MT7623 ethernet')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.
diff mbox

Patch

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 9759fe5..c2c2e206 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -661,6 +661,8 @@  err_dma:
 		itxd = mtk_qdma_phys_to_virt(ring, itxd->txd2);
 	} while (itxd != txd);
 
+	spin_unlock_irqrestore(&eth->page_lock, flags);
+
 	return -ENOMEM;
 }