Re: Detecting invalid gpio keys configuration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12.03.2022 02:11, Jeff LaBundy wrote:
> Hi Tomasz,

Hi Jeff,

> On Thu, Mar 10, 2022 at 07:57:53AM +0100, Tomasz Moń wrote:
>> While provided example hopefully crashes every time making the issue
>> obvious, other code values can cause much more subtle issues.
>> Should the input_set_capability() warn if code is outside bitmap range?
>>
>> Best Regards,
>> Tomasz Mon
>>
> 
> What about something like the patch below? It of course can't prevent
> dts from specifying something like KEY_ESC as a switch, but should at
> least prevent kernel panic.

Your patch does prevent the kernel panic. On top of that, it also makes
troubleshooting much easier. That is, directly pinpointing the issue in
error message essentially skips the debugging part.

I think this is the only place where a code check is missing. The other
places do already use is_event_supported() that checks if code is below
or equal to the maximum allowed.

So I am in favor of your patch.

Reviewed-by: Tomasz Moń <tomasz.mon@xxxxxxxxxxxxxxx>

Best Regards,
Tomasz Mon





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux