]> git.baikalelectronics.ru Git - kernel.git/commit
Input: iqs7222 - avoid dereferencing a NULL pointer
authorJeff LaBundy <jeff@labundy.com>
Sun, 17 Apr 2022 23:05:07 +0000 (16:05 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 17 Apr 2022 23:08:58 +0000 (16:08 -0700)
commit6569d6b19d35ed78870cbb01571e855ae6998574
treea87902e8d682274d0f87c47174858beb8490ca9b
parentb234a29edb4a0e6e41249bb8873f6d3f1f9d0f63
Input: iqs7222 - avoid dereferencing a NULL pointer

Select callers of iqs7222_parse_props() do not expect a child node
to be derived and returned via pointer. As such, these callers set
**child_node to NULL. However, this pointer is dereferenced in all
cases.

To solve this problem, dereference the pointer only for cases that
expect a child node in the first place. In these cases, the caller
provides a valid pointer.

Fixes: 27eaac94c6be ("Input: add support for Azoteq IQS7222A/B/C")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220417214132.497487-1-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/iqs7222.c