Patch "cifs: fix wrong release in sess_alloc_buffer() failed path" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    cifs: fix wrong release in sess_alloc_buffer() failed path

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     cifs-fix-wrong-release-in-sess_alloc_buffer-failed-p.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 99c623e9bc043f3ff44d7f76e961c70d9a00d64b
Author: Ding Hui <dinghui@xxxxxxxxxxxxxx>
Date:   Tue Aug 17 22:55:10 2021 +0800

    cifs: fix wrong release in sess_alloc_buffer() failed path
    
    [ Upstream commit d72c74197b70bc3c95152f351a568007bffa3e11 ]
    
    smb_buf is allocated by small_smb_init_no_tc(), and buf type is
    CIFS_SMALL_BUFFER, so we should use cifs_small_buf_release() to
    release it in failed path.
    
    Signed-off-by: Ding Hui <dinghui@xxxxxxxxxxxxxx>
    Reviewed-by: Paulo Alcantara (SUSE) <pc@xxxxxx>
    Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index aa23c00367ec..0113dba28eb0 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -602,7 +602,7 @@ sess_alloc_buffer(struct sess_data *sess_data, int wct)
 	return 0;
 
 out_free_smb_buf:
-	kfree(smb_buf);
+	cifs_small_buf_release(smb_buf);
 	sess_data->iov[0].iov_base = NULL;
 	sess_data->iov[0].iov_len = 0;
 	sess_data->buf0_type = CIFS_NO_BUFFER;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux