From: Ronnie Sahlberg Date: Tue, 23 Apr 2019 06:39:45 +0000 (+1000) Subject: cifs: fix memory leak in SMB2_read X-Git-Tag: v4.19.38~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5bf783a09a06c81ca4783054355f1d243e124e7;p=platform%2Fkernel%2Flinux-rpi3.git cifs: fix memory leak in SMB2_read commit 05fd5c2c61732152a6bddc318aae62d7e436629b upstream. Commit 088aaf17aa79300cab14dbee2569c58cfafd7d6e introduced a leak where if SMB2_read() returned an error we would return without freeing the request buffer. Cc: Stable Signed-off-by: Ronnie Sahlberg Reviewed-by: Pavel Shilovsky Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index c6fd3ac..33afb63 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3285,6 +3285,7 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, rc); } free_rsp_buf(resp_buftype, rsp_iov.iov_base); + cifs_small_buf_release(req); return rc == -ENODATA ? 0 : rc; } else trace_smb3_read_done(xid, req->PersistentFileId,