diff mbox

[-next] tile: fix missing unlock on error in tile_net_open()

Message ID CAPgLHd8k5yfO4G1Fvz86VSC-HbwgGEb8OwTShAa5e+owRvaMqg@mail.gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Wei Yongjun Aug. 5, 2013, 4:42 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Add the missing unlock before return from function tile_net_open()
in the error handling case.

Introduced by commit f3286a3af89d6db7a488f3e8f02b98d67d50f00c.
(tile: support multiple mPIPE shims in tilegx network driver)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/ethernet/tile/tilegx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Chris Metcalf Aug. 5, 2013, 3:10 p.m. UTC | #1
On 8/5/2013 12:42 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Add the missing unlock before return from function tile_net_open()
> in the error handling case.
>
> Introduced by commit f3286a3af89d6db7a488f3e8f02b98d67d50f00c.
> (tile: support multiple mPIPE shims in tilegx network driver)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/net/ethernet/tile/tilegx.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Thanks!

Acked-by: Chris Metcalf <cmetcalf@tilera.com>
David Miller Aug. 5, 2013, 6:09 p.m. UTC | #2
From: Chris Metcalf <cmetcalf@tilera.com>
Date: Mon, 5 Aug 2013 11:10:29 -0400

> On 8/5/2013 12:42 AM, Wei Yongjun wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> Add the missing unlock before return from function tile_net_open()
>> in the error handling case.
>>
>> Introduced by commit f3286a3af89d6db7a488f3e8f02b98d67d50f00c.
>> (tile: support multiple mPIPE shims in tilegx network driver)
>>
>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>> ---
>>  drivers/net/ethernet/tile/tilegx.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> Thanks!
> 
> Acked-by: Chris Metcalf <cmetcalf@tilera.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c
index 907b577..5d2a719 100644
--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -1510,8 +1510,10 @@  static int tile_net_open(struct net_device *dev)
 
 	/* Get the instance info. */
 	rc = gxio_mpipe_link_instance(dev->name);
-	if (rc < 0 || rc >= NR_MPIPE_MAX)
+	if (rc < 0 || rc >= NR_MPIPE_MAX) {
+		mutex_unlock(&tile_net_devs_for_channel_mutex);
 		return -EIO;
+	}
 
 	priv->instance = rc;
 	instance = rc;