From: Al Viro <viro@zeniv.linux.org.uk>
To: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
hannes@cmpxchg.org, yosry.ahmed@linux.dev, nphamcs@gmail.com,
chengming.zhou@linux.dev, usamaarif642@gmail.com,
ryan.roberts@arm.com, 21cnbao@gmail.com,
ying.huang@linux.alibaba.com, akpm@linux-foundation.org,
senozhatsky@chromium.org, wajdi.k.feghali@intel.com,
vinodh.gopal@intel.com
Subject: Re: [PATCH v1 1/2] mm: zswap: Per-CPU acomp_ctx resources exist from pool creation to deletion.
Date: Mon, 7 Jul 2025 23:06:16 +0100 [thread overview]
Message-ID: <20250707220616.GN1880847@ZenIV> (raw)
In-Reply-To: <20250707201315.9497-2-kanchana.p.sridhar@intel.com>
On Mon, Jul 07, 2025 at 01:13:14PM -0700, Kanchana P Sridhar wrote:
> +static void acomp_ctx_dealloc(struct crypto_acomp_ctx *acomp_ctx)
> +{
> + if (IS_ERR_OR_NULL(acomp_ctx))
Ugh.
> + return;
> +
> + if (!IS_ERR_OR_NULL(acomp_ctx->req))
Ugh.
> + acomp_request_free(acomp_ctx->req);
> +
> + if (!IS_ERR_OR_NULL(acomp_ctx->acomp))
Ugh.
> + crypto_free_acomp(acomp_ctx->acomp);
> +
> + kfree(acomp_ctx->buffer);
Just what are those IS_ERR_OR_NULL about? Is it IS_ERR() or is it NULL?
Either has valid uses, but mixing them is not something you do without a
good reason; there are valid calling conventions that allow all three of
"address of an object", NULL and ERR_PTR(-E...), but that's not something
you do just in case - there should be an explanation of what's going on.
next prev parent reply other threads:[~2025-07-07 22:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 20:13 [PATCH v1 0/2] zswap per-CPU acomp_ctx resources track the pool's lifetime Kanchana P Sridhar
2025-07-07 20:13 ` [PATCH v1 1/2] mm: zswap: Per-CPU acomp_ctx resources exist from pool creation to deletion Kanchana P Sridhar
2025-07-07 22:06 ` Al Viro [this message]
2025-07-08 0:03 ` Sridhar, Kanchana P
2025-07-07 20:13 ` [PATCH v1 2/2] mm: zswap: Consistently use IS_ERR_OR_NULL() to check acomp_ctx resources Kanchana P Sridhar
2025-07-07 21:36 ` Nhat Pham
2025-07-07 21:36 ` Nhat Pham
2025-07-07 23:59 ` Sridhar, Kanchana P
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=20250707220616.GN1880847@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=hannes@cmpxchg.org \
--cc=kanchana.p.sridhar@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=ryan.roberts@arm.com \
--cc=senozhatsky@chromium.org \
--cc=usamaarif642@gmail.com \
--cc=vinodh.gopal@intel.com \
--cc=wajdi.k.feghali@intel.com \
--cc=ying.huang@linux.alibaba.com \
--cc=yosry.ahmed@linux.dev \
/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