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: <aV4b6GAGz1zyf8Xy@stanley.mountain>
Date: Wed, 7 Jan 2026 11:40:08 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Jonas Jelonek <jelonek.jonas@...il.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
	Bartosz Golaszewski <brgl@...ev.pl>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>, Peter Rosin <peda@...ntia.se>,
	Geert Uytterhoeven <geert+renesas@...der.be>,
	linux-gpio@...r.kernel.org, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Thomas Richard <thomas.richard@...tlin.com>
Subject: Re: [PATCH v7 2/2] gpio: add gpio-line-mux driver

On Sat, Dec 27, 2025 at 06:01:34PM +0000, Jonas Jelonek wrote:
> +struct gpio_lmux {
> +	struct gpio_chip gc;
> +	struct mux_control *mux;
> +	struct gpio_desc *muxed_gpio;
> +
> +	u32 num_gpio_mux_states;
> +	unsigned int gpio_mux_states[] __counted_by(num_gpio_mux_states);
> +};
> +
> +static int gpio_lmux_gpio_get(struct gpio_chip *gc, unsigned int offset)
> +{
> +	struct gpio_lmux *glm = gpiochip_get_data(gc);
> +	int ret;
> +
> +	if (offset > gc->ngpio)

This is off by one.  Should be >=.

regards,
dan carpenter

> +		return -EINVAL;
> +
> +	ret = mux_control_select_delay(glm->mux, glm->gpio_mux_states[offset],
> +				       MUX_SELECT_DELAY_US);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = gpiod_get_raw_value_cansleep(glm->muxed_gpio);
> +	mux_control_deselect(glm->mux);
> +	return ret;
> +}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ