Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'gpio-fixes-for-v5.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fix from Bartosz Golaszewski:
"A single fix for an older problem with the sysfs interface: do not
allow exporting GPIO lines which were marked invalid by the driver"

* tag 'gpio-fixes-for-v5.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
gpio: sysfs: Obey valid_mask

+8
+8
drivers/gpio/gpiolib-sysfs.c
··· 458 458 long gpio; 459 459 struct gpio_desc *desc; 460 460 int status; 461 + struct gpio_chip *gc; 462 + int offset; 461 463 462 464 status = kstrtol(buf, 0, &gpio); 463 465 if (status < 0) ··· 469 467 /* reject invalid GPIOs */ 470 468 if (!desc) { 471 469 pr_warn("%s: invalid GPIO %ld\n", __func__, gpio); 470 + return -EINVAL; 471 + } 472 + gc = desc->gdev->chip; 473 + offset = gpio_chip_hwgpio(desc); 474 + if (!gpiochip_line_is_valid(gc, offset)) { 475 + pr_warn("%s: GPIO %ld masked\n", __func__, gpio); 472 476 return -EINVAL; 473 477 } 474 478