Linux block layer
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Yi Zhang <yi.zhang@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-block <linux-block@vger.kernel.org>
Subject: Re: [bug report] RIP: 0010:blkg_free+0xa/0xe0 observed on latest linux-block/for-next
Date: Mon, 6 Feb 2023 07:53:43 +0100	[thread overview]
Message-ID: <20230206065343.GA9951@lst.de> (raw)
In-Reply-To: <CAHj4cs_HT+iqoPkRcAFr8A4o5C3TzDE6h2fA-ZUbhiek7-MwnA@mail.gmail.com>

This should fix it:

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 8faeca6022bea0..c46778d1f3c27d 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -383,7 +383,8 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, struct gendisk *disk,
 err_put_css:
 	css_put(&blkcg->css);
 err_free_blkg:
-	blkg_free(new_blkg);
+	if (new_blkg)
+		blkg_free(new_blkg);
 	return ERR_PTR(ret);
 }
 

  reply	other threads:[~2023-02-06  6:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06  5:22 [bug report] RIP: 0010:blkg_free+0xa/0xe0 observed on latest linux-block/for-next Yi Zhang
2023-02-06  6:20 ` Christoph Hellwig
2023-02-06  6:46   ` Yi Zhang
2023-02-06  6:53     ` Christoph Hellwig [this message]
2023-02-06  7:31       ` Yi Zhang

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=20230206065343.GA9951@lst.de \
    --to=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=yi.zhang@redhat.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