mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Scott Guo <scottzhguo@tencent.com>,
	Phillip Lougher <phillip@squashfs.org.uk>
Cc: scott_gzh@163.com, LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] squashfs: Avoid mem leak in squashfs_fill_super
Date: Mon, 11 Aug 2025 09:02:22 +0200	[thread overview]
Message-ID: <24759bdb-b427-47a7-b9c3-724a11d0162e@web.de> (raw)
In-Reply-To: <20250811061921.3807353-1-scott_gzh@163.com>

> If sb_min_blocksize returns 0, -EINVAL was returned without freeing
> sb->s_fs_info, causing mem leak.

                         memory?


How do you think about to append parentheses to the function name (in the summary phrase)?


> Fix it by goto failed_mount.

By the way:
I propose to refine the goto chain by using additional labels like “e_inval” and “e_nomem”
so that another bit of exception handling code can be shared at the end
of this function implementation.
https://elixir.bootlin.com/linux/v6.16/source/fs/squashfs/super.c#L434-L466

Regards,
Markus

  reply	other threads:[~2025-08-11  7:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11  6:19 scott_gzh
2025-08-11  7:02 ` Markus Elfring [this message]
2025-08-12  2:11   ` Scott Guo
2025-08-12  8:18     ` Dan Carpenter
2025-08-12  8:38       ` Markus Elfring
2025-08-12  9:20         ` Dan Carpenter
2025-08-11 22:35 ` [PATCH] " Phillip Lougher
2025-08-12  2:11   ` Scott Guo

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=24759bdb-b427-47a7-b9c3-724a11d0162e@web.de \
    --to=markus.elfring@web.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phillip@squashfs.org.uk \
    --cc=scott_gzh@163.com \
    --cc=scottzhguo@tencent.com \
    /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

all inboxes | Powered by JetHome®