diff mbox

ocfs2: remove bogus check in dlm_process_recovery_data

Message ID 5490D357.1080506@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joseph Qi Dec. 17, 2014, 12:50 a.m. UTC
In dlm_process_recovery_data, only when dlm_new_lock failed the ret
will be set to -ENOMEM. And in this case, newlock is definitely NULL.
So test newlock is meaningless, remove it.

Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Reviewed-by: Alex Chen <alex.chen@huawei.com>
---
 fs/ocfs2/dlm/dlmrecovery.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Mark Fasheh Dec. 19, 2014, 1:01 a.m. UTC | #1
On Wed, Dec 17, 2014 at 08:50:31AM +0800, Joseph Qi wrote:
> In dlm_process_recovery_data, only when dlm_new_lock failed the ret
> will be set to -ENOMEM. And in this case, newlock is definitely NULL.
> So test newlock is meaningless, remove it.
> 
> Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
> Reviewed-by: Alex Chen <alex.chen@huawei.com>

Reviewed-by: Mark Fasheh <mfasheh@suse.de>
	--Mark

--
Mark Fasheh
diff mbox

Patch

diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index 3365839..a239010 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -2015,11 +2015,8 @@  leave:
 	dlm_lockres_drop_inflight_ref(dlm, res);
 	spin_unlock(&res->spinlock);

-	if (ret < 0) {
+	if (ret < 0)
 		mlog_errno(ret);
-		if (newlock)
-			dlm_lock_put(newlock);
-	}

 	return ret;
 }