Re: [PATCH] regulator: max8907: fix compile error when !CONFIG_OF

From: Axel Lin
Date: Mon Aug 20 2012 - 21:21:46 EST


> +
> +static inline struct regulator_init_data *match_init_data(int index)
> +{
> + return NULL;
> +}
> +

Now match_init_data() returns NULL if !CONFIG_OF, so idata may be NULL.

Then I think we may hit NULL pointer dereference here:

switch (pmic->desc[i].id) {
case MAX8907_MBATT:
mbatt_rail_name = idata->constraints.name;
break;

Regards,
Axel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/