]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Input: cs40l50-vibra - fix potential NULL dereference in cs40l50_upload_owt()
authorYunshui Jiang <jiangyunshui@kylinos.cn>
Fri, 4 Jul 2025 04:56:02 +0000 (21:56 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 4 Jul 2025 05:20:46 +0000 (22:20 -0700)
commit4cf65845fdd09d711fc7546d60c9abe010956922
tree99b8a9adf283a943db83ea618098a498423be7d6
parenta106b6a888caf478d5fd31d123ffa09558500772
Input: cs40l50-vibra - fix potential NULL dereference in cs40l50_upload_owt()

The cs40l50_upload_owt() function allocates memory via kmalloc()
without checking for allocation failure, which could lead to a
NULL pointer dereference.

Return -ENOMEM in case allocation fails.

Signed-off-by: Yunshui Jiang <jiangyunshui@kylinos.cn>
Fixes: c38fe1bb5d21 ("Input: cs40l50 - Add support for the CS40L50 haptic driver")
Link: https://lore.kernel.org/r/20250704024010.2353841-1-jiangyunshui@kylinos.cn
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/cs40l50-vibra.c