From: Julien Grall Date: Fri, 13 Sep 2013 12:49:33 +0000 (+0100) Subject: xen/arm: Check if the device is available before using it X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6334 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=735d865183306c85c8ef8a16f8a82c48359e9bee;p=xen.git xen/arm: Check if the device is available before using it It's possible to have a device description in the DTS but the device is not wired. device_init must check if the device is available before doing anything with it. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c index dc751a979a..f86b2e3f33 100644 --- a/xen/arch/arm/device.c +++ b/xen/arch/arm/device.c @@ -47,6 +47,9 @@ int __init device_init(struct dt_device_node *dev, enum device_type type, ASSERT(dev != NULL); + if ( !dt_device_is_available(dev) ) + return -ENODEV; + for ( desc = _sdevice; desc != _edevice; desc++ ) { if ( desc->type != type )