Skip to contentSkip to conversation

cifs: add kfree() on error path

PATCH In review Dan Carpenter 3 participants 3 messages Oct 27, 2010 – Oct 28, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 cifs: add kfree() on error path

We leak 256 bytes here on this error path.

fs/cifs/file.c +1 -0
index 45af003..06a006b 100644
@@ -1353,6 +1353,7 @@ static int cifs_writepages(struct address_space *mapping,
 	if (!experimEnabled && tcon->ses->server->secMode &
 			(SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) {
 		cifsFileInfo_put(open_file);
+		kfree(iov);
 		return generic_writepages(mapping, wbc);
 	}
 	cifsFileInfo_put(open_file);
Acked-by on v1 1/2
#1 lore raw
Quoted 9 lines · On Wed, 27 Oct 2010 23:19:32 +0200 Dan Carpenter <[email protected]> wrote:

We leak 256 bytes here on this error path.

fs/cifs/file.c +0 -0
index 45af003..06a006b 100644

fs/cifs/file.c static int cifs_writepages(struct address_space *mapping, · line 1359

Quoted 7 lines
fs/cifs/file.c +1 -0
@@ -1353,6 +1353,7 @@ static int cifs_writepages(struct address_space *mapping,
 	if (!experimEnabled && tcon->ses->server->secMode &
 			(SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) {
 		cifsFileInfo_put(open_file);
+		kfree(iov);
 		return generic_writepages(mapping, wbc);
 	}
 	cifsFileInfo_put(open_file);

Good catch.

#2 lore raw
In reply to Dan Carpenter
Quoted 9 lines · Dan Carpenter

We leak 256 bytes here on this error path.

fs/cifs/file.c +0 -0
index 45af003..06a006b 100644
@@ -1353,6 +1353,7 @@ static int cifs_writepages(struct address_space *mapping,
Quoted 7 lines

       if (!experimEnabled && tcon->ses->server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) { cifsFileInfo_put(open_file);
+               kfree(iov);
               return generic_writepages(mapping, wbc);
       }
       cifsFileInfo_put(open_file);

Yes. obviously correct.- merged.

Signature · 7 lines
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html