Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Sep 2016 18:54:08 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r306274 - head/sys/dev/evdev
Message-ID:  <201609231854.u8NIs8gM091863@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Fri Sep 23 18:54:08 2016
New Revision: 306274
URL: https://svnweb.freebsd.org/changeset/base/306274

Log:
  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>

Modified:
  head/sys/dev/evdev/evdev.c

Modified: head/sys/dev/evdev/evdev.c
==============================================================================
--- head/sys/dev/evdev/evdev.c	Fri Sep 23 17:24:06 2016	(r306273)
+++ head/sys/dev/evdev/evdev.c	Fri Sep 23 18:54:08 2016	(r306274)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609231854.u8NIs8gM091863>