diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index e4a21e42e868..a0144c6a8ad1 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -113,7 +113,8 @@ struct visor_driver { struct driver_attribute version_attr; }; -#define to_visor_driver(x) container_of(x, struct visor_driver, driver) +#define to_visor_driver(x) ((x) ? \ + (container_of(x, struct visor_driver, driver)) : (NULL)) /** A device type for things "plugged" into the visorbus bus */