From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dong Aisheng Subject: Re: [PATCH V2] pinctrl: fix signed vs unsigned conditionals inside pinmux_map_to_setting Date: Tue, 24 Apr 2012 13:34:17 +0800 Message-ID: <20120424053416.GB32166@shlinux2.ap.freescale.net> References: <1335200518-3640-1-git-send-email-blogic@openwrt.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1335200518-3640-1-git-send-email-blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: John Crispin Cc: Dong Aisheng , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org List-Id: devicetree@vger.kernel.org On Mon, Apr 23, 2012 at 07:01:58PM +0200, John Crispin wrote: > pinmux_map_to_setting() uses setting->data.mux.func/group to store the return > code of pinmux_func_name_to_selector/pinctrl_get_group_selector(). However, > struct pinctrl_setting_mux defines these elements as unsigned, resulting in all > error codes getting lost. The conditionals following the assignments will always > evaluate to false thus breaking the error paths. > > This bug can be triggered by loading a pinmux group map from the devicetree > with an invalid function/group string. > > Signed-off-by: John Crispin > Cc: Stephen Warren > Cc: Dong Aisheng > --- > drivers/pinctrl/pinmux.c | 15 ++++++++------- > 1 files changed, 8 insertions(+), 7 deletions(-) > Nice fix. Acked-by: Dong Aisheng Regards Dong Aisheng