]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/regulator/core.c
regulator: check for init_data on registration
[linux-2.6-omap-h63xx.git] / drivers / regulator / core.c
index 84202eaace57aacfc17d90564b118315bff371cc..65e07b941a36232a184a8a8361d68f8b7a15bd02 100644 (file)
@@ -1691,6 +1691,9 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
            !regulator_desc->type == REGULATOR_CURRENT)
                return ERR_PTR(-EINVAL);
 
+       if (!init_data)
+               return ERR_PTR(-EINVAL);
+
        rdev = kzalloc(sizeof(struct regulator_dev), GFP_KERNEL);
        if (rdev == NULL)
                return ERR_PTR(-ENOMEM);