public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: zhanchengbin <zhanchengbin1@huawei.com>
To: <sandeen@sandeen.net>, <djwong@kernel.org>
Cc: <liuzhiqiang26@huawei.com>, linfeilong <linfeilong@huawei.com>,
	<linux-xfs@vger.kernel.org>
Subject: [PATCH 3/3] repair/slab.c: avoid to use NULL pointer
Date: Mon, 6 Jun 2022 20:34:06 +0800	[thread overview]
Message-ID: <3725e3ef-2206-8244-e14d-5ffc28e1a68b@huawei.com> (raw)
In-Reply-To: <7f4abf2a-5ea5-e2ee-786e-88d871d29475@huawei.com>

Changed malloc to xmalloc.

Signed-off-by: zhanchengbin <zhanchengbin1@huawei.com>
---
  repair/slab.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repair/slab.c b/repair/slab.c
index 165f97ef..13fc8203 100644
--- a/repair/slab.c
+++ b/repair/slab.c
@@ -237,7 +237,7 @@ qsort_slab(
  	create_work_queue(&wq, NULL, platform_nproc());
  	hdr = slab->s_first;
  	while (hdr) {
-		qs = malloc(sizeof(struct qsort_slab));
+		qs = xmalloc(sizeof(struct qsort_slab));
  		qs->slab = slab;
  		qs->hdr = hdr;
  		qs->compare_fn = compare_fn;
-- 
2.27.0


      parent reply	other threads:[~2022-06-06 12:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 12:31 [PATCH 0/3] xfsprogs: avoid to use NULL pointer zhanchengbin
2022-06-06 12:33 ` [PATCH 1/3] mkfs/proto.c: " zhanchengbin
2022-06-06 14:29   ` Eric Sandeen
2022-06-06 21:46     ` Dave Chinner
2022-06-06 12:33 ` [PATCH 2/3] db: " zhanchengbin
2022-06-06 12:34 ` zhanchengbin [this message]

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=3725e3ef-2206-8244-e14d-5ffc28e1a68b@huawei.com \
    --to=zhanchengbin1@huawei.com \
    --cc=djwong@kernel.org \
    --cc=linfeilong@huawei.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=liuzhiqiang26@huawei.com \
    --cc=sandeen@sandeen.net \
    /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