Handle NULL argument in evdev_free
Add check for evdev argument of evdev_free being NULL. This is valid value and should not cause crash. In this case evdev_free does nothing Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
This commit is contained in:
parent
3cdfcb51aa
commit
c3f2135cfc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306274
@ -92,7 +92,8 @@ void
|
||||
evdev_free(struct evdev_dev *evdev)
|
||||
{
|
||||
|
||||
if (evdev->ev_cdev != NULL && evdev->ev_cdev->si_drv1 != NULL)
|
||||
if (evdev != NULL && evdev->ev_cdev != NULL &&
|
||||
evdev->ev_cdev->si_drv1 != NULL)
|
||||
evdev_unregister(evdev);
|
||||
|
||||
free(evdev, M_EVDEV);
|
||||
|
Loading…
Reference in New Issue
Block a user