From: "Bence Csókás" <bence98@sch.bme.hu>
To: Triet Hoang <triet.hoang.dev@gmail.com>
Cc: andi.shyti@kernel.org, linux-i2c@vger.kernel.org,
linux-kernel@vger.kernel.org,
Markus Elfring <Markus.Elfring@web.de>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v2] i2c: cp2615: handle allocation failure
Date: Fri, 28 Aug 2026 14:08:19 +0200 [thread overview]
Message-ID: <05df77ed-855c-4897-857e-0bc2439666d4@sch.bme.hu> (raw)
In-Reply-To: <20260818111703.19604-1-triet.hoang.dev@gmail.com>
Hi,
On 8/18/26 13:17, Triet Hoang wrote:
> Check the result of kzalloc_obj() and return -ENOMEM
> when the allocation fails instead of passing a NULL pointer
> to the message initialization helpers, which would return -EINVAL.
>
> Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
Just change the -EINVAL to -ENOMEM. This is something which has been
discussed before [1] as a potential to-do.
[1]
https://lore.kernel.org/lkml/CACCVKEFXOKhXmF3rcmKQ8-aMFZJLZOf+imsuBYKAQsWptrJG6Q@mail.gmail.com/
On 8/19/26 08:28, Markus Elfring wrote:
> * How do you think about to increase the application of scope-based
resource management?
I second this, this old code could use some RAII modernization.
Bence
next prev parent reply other threads:[~2026-08-28 12:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-16 16:17 [PATCH] i2c: cp2615: handle allocation failure Triet Hoang
2026-08-18 11:17 ` [PATCH v2] " Triet Hoang
2026-08-19 6:28 ` Markus Elfring
2026-08-28 12:08 ` Bence Csókás [this message]
2026-08-28 17:09 ` Andi Shyti
2026-08-28 20:12 ` Bence Csókás
2026-08-28 17:09 ` Andi Shyti
2026-08-28 20:40 ` Christophe JAILLET
2026-08-29 3:42 ` Triet Hoang
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=05df77ed-855c-4897-857e-0bc2439666d4@sch.bme.hu \
--to=bence98@sch.bme.hu \
--cc=Markus.Elfring@web.de \
--cc=andi.shyti@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=triet.hoang.dev@gmail.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