]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
HID: core: fix NULL pointer dereference
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Wed, 29 Aug 2018 15:22:09 +0000 (10:22 -0500)
committerJiri Kosina <jkosina@suse.cz>
Wed, 5 Sep 2018 08:08:07 +0000 (10:08 +0200)
commitb034ed50a2bb517c4b76e84f7723cb6bf60a4edd
tree1b7d4c13ba8401342f7e122f9ab95f400e707995
parent0d6c3011409135ea84e2a231b013a22017ff999a
HID: core: fix NULL pointer dereference

There is a NULL pointer dereference in case memory resources
for *parse* are not successfully allocated.

Fix this by adding a new goto label and make the execution
path jump to it in case vzalloc() fails.

Addresses-Coverity-ID: 1473081 ("Dereference after null check")
Fixes: b2dd9f2e5a8a ("HID: core: fix memory leak on probe")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-core.c