svn commit: r356225 - head/sys/dev/atkbdc
Kyle Evans
kevans at FreeBSD.org
Tue Dec 31 13:56:49 UTC 2019
Author: kevans
Date: Tue Dec 31 13:56:48 2019
New Revision: 356225
URL: https://svnweb.freebsd.org/changeset/base/356225
Log:
psm: properly check for atkbdc_open failure
atkbdc_open can return NULL if the unit's out of bounds or the softc isn't
setup. Check it to be safe.
Modified:
head/sys/dev/atkbdc/psm.c
Modified: head/sys/dev/atkbdc/psm.c
==============================================================================
--- head/sys/dev/atkbdc/psm.c Tue Dec 31 12:29:01 2019 (r356224)
+++ head/sys/dev/atkbdc/psm.c Tue Dec 31 13:56:48 2019 (r356225)
@@ -1390,6 +1390,8 @@ psmprobe(device_t dev)
sc->unit = unit;
sc->kbdc = atkbdc_open(device_get_unit(device_get_parent(dev)));
+ if (sc->kbdc == NULL)
+ return (ENXIO);
sc->config = device_get_flags(dev) & PSM_CONFIG_FLAGS;
/* XXX: for backward compatibility */
#if defined(PSM_HOOKRESUME) || defined(PSM_HOOKAPM)
More information about the svn-src-head
mailing list