HID: potential dereference of null pointer
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Wed, 15 Dec 2021 08:36:05 +0000 (16:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Dec 2021 11:28:37 +0000 (12:28 +0100)
commitb1712a691bbb1d178dcf1cb592b5746d13fb7d49
tree44209bb29ff5c9d92f6c38a370714c3c9c369935
parent3c431e19ad708475a6fad071934a7bb786d24319
HID: potential dereference of null pointer

commit 13251ce1dd9bb525da2becb9b26fdfb94ca58659 upstream.

The return value of devm_kzalloc() needs to be checked.
To avoid hdev->dev->driver_data to be null in case of the failure of
alloc.

Fixes: 14c9c014babe ("HID: add vivaldi HID driver")
Cc: stable@vger.kernel.org
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20211215083605.117638-1-jiasheng@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-vivaldi.c