Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Sep 2016 05:27:13 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r306288 - head/sys/dev/iicbus
Message-ID:  <201609240527.u8O5RDpp011588@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Sat Sep 24 05:27:12 2016
New Revision: 306288
URL: https://svnweb.freebsd.org/changeset/base/306288

Log:
  Fix ds1307 probing
  
  'compat' can never be NULL, because the compatible check loop ends when
  compat->ocd_str is NULL.  This causes ds1307 to attach to any unclaimed i2c
  device.

Modified:
  head/sys/dev/iicbus/ds1307.c

Modified: head/sys/dev/iicbus/ds1307.c
==============================================================================
--- head/sys/dev/iicbus/ds1307.c	Sat Sep 24 04:08:16 2016	(r306287)
+++ head/sys/dev/iicbus/ds1307.c	Sat Sep 24 05:27:12 2016	(r306288)
@@ -274,7 +274,7 @@ ds1307_probe(device_t dev)
 
 	compat = ofw_bus_search_compatible(dev, ds1307_compat_data);
 
-	if (compat == NULL)
+	if (compat->ocd_str == NULL)
 		return (ENXIO);
 
 	device_set_desc(dev, (const char *)compat->ocd_data);



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