staging/lustre: fix 'program hangs' errors
authorSebastien Buisson <sebastien.buisson@bull.net>
Mon, 22 Jul 2013 16:06:26 +0000 (00:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 19:39:21 +0000 (12:39 -0700)
Fix 'program hangs' defects found by Coverity version 6.5.1:
Missing unlock (LOCK)
Returning without unlocking.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3054
Lustre-change: http://review.whamcloud.com/5870
Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/selftest/rpc.c

index bc1f38b804867f302c01460d7f54cf1534996bbd..0dfc76e02e0bdbb7a567eda2be25870541ae87a7 100644 (file)
@@ -661,8 +661,10 @@ srpc_finish_service(struct srpc_service *sv)
 
        cfs_percpt_for_each(scd, i, sv->sv_cpt_data) {
                spin_lock(&scd->scd_lock);
-               if (!swi_deschedule_workitem(&scd->scd_buf_wi))
+               if (!swi_deschedule_workitem(&scd->scd_buf_wi)) {
+                       spin_unlock(&scd->scd_lock);
                        return 0;
+               }
 
                if (scd->scd_buf_nposted > 0) {
                        CDEBUG(D_NET, "waiting for %d posted buffers to unlink",