CIFS: Fix a memory leak when a lease break comes
authorPavel Shilovsky <pshilovsky@samba.org>
Thu, 5 Sep 2013 11:04:04 +0000 (15:04 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Sep 2013 00:18:04 +0000 (17:18 -0700)
commit 1a05096de82f3cd672c76389f63964952678506f upstream.

This happens when we receive a lease break from a server, then
find an appropriate lease key in opened files and schedule the
oplock_break slow work. lw pointer isn't freed in this case.

Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2misc.c

index 10383d8c015b12c4aa7bd936972e58bca97a648b..2b1dc7f4464ab332c3bfe6806ee352ec7c43c3af 100644 (file)
@@ -469,6 +469,7 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
 
                                queue_work(cifsiod_wq, &cfile->oplock_break);
 
+                               kfree(lw);
                                spin_unlock(&cifs_file_list_lock);
                                spin_unlock(&cifs_tcp_ses_lock);
                                return true;