Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754820Ab2HUBV1 (ORCPT ); Mon, 20 Aug 2012 21:21:27 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:54952 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752330Ab2HUBVY (ORCPT ); Mon, 20 Aug 2012 21:21:24 -0400 MIME-Version: 1.0 Reply-To: axel.lin@gmail.com In-Reply-To: <1345477150-25933-1-git-send-email-swarren@wwwdotorg.org> References: <1345477150-25933-1-git-send-email-swarren@wwwdotorg.org> From: Axel Lin Date: Tue, 21 Aug 2012 09:21:03 +0800 Message-ID: Subject: Re: [PATCH] regulator: max8907: fix compile error when !CONFIG_OF To: Stephen Warren Cc: Mark Brown , Liam Girdwood , linux-kernel@vger.kernel.org, Gyungoh Yoo , Laxman Dewangan , Stephen Warren Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 681 Lines: 23 > + > +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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/