[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49ba8434-f16e-415a-9059-1af532854cb0@sirena.org.uk>
Date: Fri, 16 Jun 2023 15:59:06 +0100
From: Mark Brown <broonie@...nel.org>
To: Martin Fuzzey <martin.fuzzey@...wbird.group>
Cc: Support Opensource <support.opensource@...semi.com>,
Benjamin Bara <benjamin.bara@...data.com>,
Adam Ward <DLG-Adam.Ward.opensource@...renesas.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regulator: da9063: fix null pointer deref with partial
DT config
On Fri, Jun 16, 2023 at 04:36:28PM +0200, Martin Fuzzey wrote:
> const struct notification_limit *uv_l = &constr->under_voltage_limits;
> const struct notification_limit *ov_l = &constr->over_voltage_limits;
>
> + if (!config->init_data) /* No config in DT, pointers will be invalid */
> + return 0;
> +
We already dereferenced above when we were initialising the variables,
the compiler might still generate dereferences before it does the checks
here.
> /* make sure that only one severity is used to clarify if unchanged, enabled or disabled */
> if ((!!uv_l->prot + !!uv_l->err + !!uv_l->warn) > 1) {
> dev_err(config->dev, "%s: at most one voltage monitoring severity allowed!\n",
> --
> 2.25.1
>
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists