[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zbtqp1wgHI0LSSaE@hovoldconsulting.com>
Date: Thu, 1 Feb 2024 10:55:51 +0100
From: Johan Hovold <johan@...nel.org>
To: Doug Anderson <dianders@...omium.org>
Cc: Johan Hovold <johan+linaro@...nel.org>, Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] HID: i2c-hid-of: fix NULL-deref on failed power up
On Fri, Jan 26, 2024 at 09:47:23AM -0800, Doug Anderson wrote:
> On Fri, Jan 26, 2024 at 9:10 AM Johan Hovold <johan+linaro@...nel.org> wrote:
> > A while back the I2C HID implementation was split in an ACPI and OF
> > part, but the new OF driver never initialises the client pointer which
> > is dereferenced on power-up failures.
> Good catch and thanks for the fix. FWIW, I'd be OK w/
>
> Reviewed-by: Douglas Anderson <dianders@...omium.org>
>
> That being said, I'd be even happier if you simply removed the
> "client" from the structure and removed the error printout.
> regulator_bulk_enable() already prints error messages when a failure
> happens and thus the error printout is redundant and wastes space.
True, but that error message does not include the device that tried to
use the regulator.
I actually hit this when adding dev_dbg() to the function in question.
For such cases, it's also convenient to have struct device easily
accessible so I think it should be ok to just leave this pointer in.
Johan
Powered by blists - more mailing lists