Linux I2C development
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@kernel.org>
To: "Bence Csókás" <bence98@sch.bme.hu>
Cc: Triet Hoang <triet.hoang.dev@gmail.com>,
	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 19:09:50 +0200	[thread overview]
Message-ID: <apHAu8HnMD14c_Au@zenone.zhora.eu> (raw)
In-Reply-To: <05df77ed-855c-4897-857e-0bc2439666d4@sch.bme.hu>

On Fri, Aug 28, 2026 at 02:08:19PM +0200, Bence Csókás wrote:
> 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.

is there a managed version for kzalloc_obj()?

Andi

  reply	other threads:[~2026-08-28 17:09 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
2026-08-28 17:09     ` Andi Shyti [this message]
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=apHAu8HnMD14c_Au@zenone.zhora.eu \
    --to=andi.shyti@kernel.org \
    --cc=Markus.Elfring@web.de \
    --cc=bence98@sch.bme.hu \
    --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