Re: [PATCH v3 1/8] gpio: mockup: improve the debugfs input sanitization

2017-06-20 Thread Linus Walleij
On Fri, Jun 9, 2017 at 1:41 PM, Bartosz Golaszewski wrote: > We're currently only checking the first character of the input to the > debugfs event files, so a string like '0sdfdsf' is valid and indicates > a falling edge event. > > Be more strict and only allow '0', '1', '0\n' & '1\n'. > > While

[PATCH v3 1/8] gpio: mockup: improve the debugfs input sanitization

2017-06-09 Thread Bartosz Golaszewski
We're currently only checking the first character of the input to the debugfs event files, so a string like '0sdfdsf' is valid and indicates a falling edge event. Be more strict and only allow '0', '1', '0\n' & '1\n'. While we're at it: move the sanitization code before the irq_enabled check so t