From: Renaud Barbier <renaud.barbier@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] ubifs: memory possibly not freed
Date: Fri, 30 Sep 2011 17:42:52 +0100 [thread overview]
Message-ID: <4E85F18C.9060904@ge.com> (raw)
Looking at the function ubifs_finddir in the file fs/ubifs/ubifs.c,
I was wondering if some memory had not been freed before
the function returns.
287 static int ubifs_finddir(struct super_block *sb, char *dirname,
288 unsigned long root_inum, unsigned long *inum)
289 {
...
299 file = kzalloc(sizeof(struct file), 0);
300 dentry = kzalloc(sizeof(struct dentry), 0);
301 dir = kzalloc(sizeof(struct inode), 0);
....
336 if ((strncmp(dirname, (char *)dent->name, nm.len) ==
0) &&
337 (strlen(dirname) == nm.len)) {
338 *inum = le64_to_cpu(dent->inum);
339 return 1;
340 }
Line 339 returns without freeing file, dentry and dir.
Maybe wrong but could somebody check that.
next reply other threads:[~2011-09-30 16:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-30 16:42 Renaud Barbier [this message]
2011-10-05 10:40 ` [U-Boot] ubifs: memory possibly not freed Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E85F18C.9060904@ge.com \
--to=renaud.barbier@ge.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox