lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210105212631.2meujp37e5jqp7eu@earth.universe>
Date:   Tue, 5 Jan 2021 22:26:31 +0100
From:   Sebastian Reichel <sre@...nel.org>
To:     Ricardo Rivera-Matos <r-rivera-matos@...com>
Cc:     robh+dt@...nel.org, linux-pm@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        dmurphy@...com
Subject: Re: [PATCH v9 2/2] power: supply: bq256xx: Introduce the BQ256XX
 charger driver

Hi,

On Tue, Jan 05, 2021 at 02:29:49PM -0600, Ricardo Rivera-Matos wrote:
> The BQ256XX family of devices are highly integrated buck chargers
> for single cell batteries.
> 
> Signed-off-by: Ricardo Rivera-Matos <r-rivera-matos@...com>
> 
> v9 - resolves two warnings issued by kernel test robot

changelog needs to be below --- btw.
(so that git am does not pick it up :))

> ---
> [...]
> +	ret = bq256xx_parse_dt(bq, psy_cfg, dev);
> +	if (ret) {
> +		dev_err(dev, "Failed to read device tree properties%d\n", ret);
> +		return ret;
> +	}
> [...]

If you want to change psy_cfg, you need to pass it by reference
and not by value (i.e. use &psy_cfg here and a pointer as argument
of bq256xx_parse_dt). Providing psy_cfg like this creates a copy
of the struct.

Did you runtime test this version? It should crash when accessing
the properties because of psy_cfg.drv_data being NULL.

> [...]
> +	ret = bq256xx_power_supply_init(bq, psy_cfg, dev);
> +	if (ret) {
> +		dev_err(dev, "Failed to register power supply\n");
> +		return ret;
> +	}

Here it's also better to just provide the address of psy_cfg
(but not strictly necessary).

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ