Re: [PATCH] iio: magnetometer: ak8975: fix potential kernel stack memory leak
From: Andy Shevchenko
Date: Fri May 15 2026 - 06:05:50 EST
On Fri, May 15, 2026 at 11:00:17AM +0200, Joshua Crofts wrote:
> On Thu, 14 May 2026 at 13:38, Joshua Crofts via B4 Relay
> <devnull+joshua.crofts1.gmail.com@xxxxxxxxxx> wrote:
...
> > - if (ret < 0)
> > + if (ret != sizeof(fval)) {
>
> Hmm, Sashiko pointed out that I am comparing a signed integer with
> an unsigned integer, which would result in type promotion and subsequent
> mangling of any potential negative values... will fix in v2.
>
> https://sashiko.dev/#/patchset/20260514-magnetometer-kernel-mem-leak-v1-1-35b48d699faf%40gmail.com
See my response. That how it should be in your v2.
--
With Best Regards,
Andy Shevchenko