diff options
author | Julia Lawall <julia@diku.dk> | 2010-05-26 05:54:21 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-29 00:18:48 -0700 |
commit | 5daf47bb4e708fde32c1856a0d049e3c3d03c36c (patch) | |
tree | 422ee585ceb87822c7e8ae18208197d25e62e23a /net | |
parent | e72e9f3814cb8c1076d627c29cec90b005838ac3 (diff) | |
download | linux-5daf47bb4e708fde32c1856a0d049e3c3d03c36c.tar.gz linux-5daf47bb4e708fde32c1856a0d049e3c3d03c36c.tar.bz2 linux-5daf47bb4e708fde32c1856a0d049e3c3d03c36c.zip |
net/rds: Add missing mutex_unlock
Add a mutex_unlock missing on the error path. In each case, whenever the
label out is reached from elsewhere in the function, mutex is not locked.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression E1;
@@
* mutex_lock(E1);
<+... when != E1
if (...) {
... when != E1
* return ...;
}
...+>
* mutex_unlock(E1);
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Reviewed-by: Zach Brown <zach.brown@oracle.com>
Acked-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/rds/ib_cm.c | 1 | ||||
-rw-r--r-- | net/rds/iw_cm.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 10ed0d55f759..f68832798db2 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -475,6 +475,7 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id, err = rds_ib_setup_qp(conn); if (err) { rds_ib_conn_error(conn, "rds_ib_setup_qp failed (%d)\n", err); + mutex_unlock(&conn->c_cm_lock); goto out; } diff --git a/net/rds/iw_cm.c b/net/rds/iw_cm.c index a9d951b4fbae..b5dd6ac39be8 100644 --- a/net/rds/iw_cm.c +++ b/net/rds/iw_cm.c @@ -452,6 +452,7 @@ int rds_iw_cm_handle_connect(struct rdma_cm_id *cm_id, err = rds_iw_setup_qp(conn); if (err) { rds_iw_conn_error(conn, "rds_iw_setup_qp failed (%d)\n", err); + mutex_unlock(&conn->c_cm_lock); goto out; } |