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: <a11f0ec8-7eaa-aa3e-8b86-555e5dbe6e3e@suse.com>
Date:   Wed, 26 Jul 2023 10:13:53 +0200
From:   Oliver Neukum <oneukum@...e.com>
To:     Stanley Chang <stanley_chang@...ltek.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Vinod Koul <vkoul@...nel.org>,
        Kishon Vijay Abraham I <kishon@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Alan Stern <stern@...land.harvard.edu>,
        Flavio Suligoi <f.suligoi@...m.it>,
        Roy Luo <royluo@...gle.com>,
        Bagas Sanjaya <bagasdotme@...il.com>,
        Ray Chi <raychi@...gle.com>, linux-phy@...ts.infradead.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-usb@...r.kernel.org
Subject: Re: [PATCH v9 2/5] phy: realtek: usb: Add driver for the Realtek SoC
 USB 2.0 PHY


Hi,

On 25.07.23 05:31, Stanley Chang wrote:
> +static int get_phy_data_by_efuse(struct rtk_phy *rtk_phy,
> +				 struct phy_parameter *phy_parameter, int index)
> +{
> +	struct phy_cfg *phy_cfg = rtk_phy->phy_cfg;
> +	u8 value = 0;
> +	struct nvmem_cell *cell;
> +	struct soc_device_attribute rtk_soc_groot[] = {
> +		    { .family = "Realtek Groot",},
> +		    { /* empty */ } };
> +
> +	if (!phy_cfg->check_efuse)
> +		goto out;
> +
> +	/* Read efuse for usb dc cal */
> +	cell = nvmem_cell_get(rtk_phy->dev, "usb-dc-cal");
> +	if (IS_ERR(cell)) {
> +		dev_dbg(rtk_phy->dev, "%s no usb-dc-cal: %ld\n",
> +			__func__, PTR_ERR(cell));
> +	} else {
> +		unsigned char *buf;
> +		size_t buf_size;
> +
> +		buf = nvmem_cell_read(cell, &buf_size);
> +		value = buf[0] & phy_cfg->dc_driving_mask;
> +
> +		kfree(buf);
> +		nvmem_cell_put(cell);

nvmem_cell_read() can take NULL as the second argument.
You are throwing away buf_size anyway.

	Regards
		Oliver

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ