summaryrefslogtreecommitdiffstats
path: root/sbin/geom/core
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2010-09-13 08:34:20 +0000
committeravg <avg@FreeBSD.org>2010-09-13 08:34:20 +0000
commitab04d6fe3f3cad0bec4d257b1064f6959ac9d358 (patch)
tree539808d49e79487aaff3b88f9d2e441ee2f92092 /sbin/geom/core
parent367de98e5d9d394f52863740e29b736e24310244 (diff)
downloadFreeBSD-src-ab04d6fe3f3cad0bec4d257b1064f6959ac9d358.zip
FreeBSD-src-ab04d6fe3f3cad0bec4d257b1064f6959ac9d358.tar.gz
bus_add_child: add specialized default implementation that calls panic
If a kobj method doesn't have any explicitly provided default implementation, then it is auto-assigned kobj_error_method. kobj_error_method is proper only for methods that return error code, because it just returns ENXIO. So, in the case of unimplemented bus_add_child caller would get (device_t)ENXIO as a return value, which would cause the mistake to go unnoticed, because return value is typically checked for NULL. Thus, a specialized null_add_child is added. It would have sufficied for correctness to return NULL, but this type of mistake was deemed to be rare and serious enough to call panic instead. Watch out for this kind of problem with other kobj methods. Suggested by: jhb, imp MFC after: 2 weeks
Diffstat (limited to 'sbin/geom/core')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud