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-v6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fixes from Bartosz Golaszewski:
"Two fixes for the GPIO testing module and one commit making Andy a
reviewer for the GPIO subsystem:

- fix a memory corruption bug in gpio-sim

- fix inconsistencies in user-space configuration of gpio-sim

- make Andy Shevchenko a reviewer for the GPIO subsystem"

* tag 'gpio-fixes-for-v6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
MAINTAINERS: add Andy Shevchenko as reviewer for the GPIO subsystem
gpio: sim: quietly ignore configured lines outside the bank
gpio: sim: fix memory corruption when adding named lines and unnamed hogs

+17 -2
+1
MAINTAINERS
··· 8799 8799 GPIO SUBSYSTEM 8800 8800 M: Linus Walleij <linus.walleij@linaro.org> 8801 8801 M: Bartosz Golaszewski <brgl@bgdev.pl> 8802 + R: Andy Shevchenko <andy@kernel.org> 8802 8803 L: linux-gpio@vger.kernel.org 8803 8804 S: Maintained 8804 8805 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
+16 -2
drivers/gpio/gpio-sim.c
··· 696 696 char **line_names; 697 697 698 698 list_for_each_entry(line, &bank->line_list, siblings) { 699 + if (line->offset >= bank->num_lines) 700 + continue; 701 + 699 702 if (line->name) { 700 703 if (line->offset > max_offset) 701 704 max_offset = line->offset; ··· 724 721 if (!line_names) 725 722 return ERR_PTR(-ENOMEM); 726 723 727 - list_for_each_entry(line, &bank->line_list, siblings) 728 - line_names[line->offset] = line->name; 724 + list_for_each_entry(line, &bank->line_list, siblings) { 725 + if (line->offset >= bank->num_lines) 726 + continue; 727 + 728 + if (line->name && (line->offset <= max_offset)) 729 + line_names[line->offset] = line->name; 730 + } 729 731 730 732 return line_names; 731 733 } ··· 762 754 763 755 list_for_each_entry(bank, &dev->bank_list, siblings) { 764 756 list_for_each_entry(line, &bank->line_list, siblings) { 757 + if (line->offset >= bank->num_lines) 758 + continue; 759 + 765 760 if (line->hog) 766 761 num_hogs++; 767 762 } ··· 780 769 781 770 list_for_each_entry(bank, &dev->bank_list, siblings) { 782 771 list_for_each_entry(line, &bank->line_list, siblings) { 772 + if (line->offset >= bank->num_lines) 773 + continue; 774 + 783 775 if (!line->hog) 784 776 continue; 785 777