ir: fix allocation of memory without size check issue [1/1]
authorQianggui Song <qianggui.song@amlogic.com>
Thu, 27 Jun 2019 10:46:29 +0000 (18:46 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Tue, 16 Jul 2019 13:18:18 +0000 (06:18 -0700)
commit61c29936bb5e17eb3dc14661139694d77c7b033d
tree1500eba3b0ba28af8f77cbebd63ebdaebc4447bf
parent9ad60eaa9c491b3b6ecd507321abbee293fcd137
ir: fix allocation of memory without size check issue [1/1]

PD#SWPL-11248

Problem:
When handling the set attribute IOCTL REMOTE_IOC_SET_KEY_NUMBER, the driver
does not limit the size of allocation with kzalloc.

Solution:
Limit the size of alllcation range, if given a value out of range, set
update flag to false and do nothing in kzalloc stage.

Verify:
W400

Change-Id: I6a4150f5615557c372738c918aad86120d149340
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
drivers/amlogic/input/remote/remote_cdev.c