diff mbox

[linux-cifs-client] Fix losing locks during fork

Message ID 201004060117.39791.piastry@etersoft.ru (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Shilovsky April 5, 2010, 9:17 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index c34b7f8..7185cd3 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -898,9 +898,10 @@  int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
                                                        1, 0, li->type, false);
                                        if (stored_rc)
                                                rc = stored_rc;
-
-                                       list_del(&li->llist);
-                                       kfree(li);
+                                       else {
+                                               list_del(&li->llist);
+                                               kfree(li);
+                                       }
                                }
                        }
                        mutex_unlock(&fid->lock_mutex);