From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966330AbcKOJPF (ORCPT ); Tue, 15 Nov 2016 04:15:05 -0500 Received: from mail-qk0-f172.google.com ([209.85.220.172]:34157 "EHLO mail-qk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965919AbcKOJPC (ORCPT ); Tue, 15 Nov 2016 04:15:02 -0500 MIME-Version: 1.0 In-Reply-To: <20161111023510.14146-1-wens@csie.org> References: <20161111023510.14146-1-wens@csie.org> From: Linus Walleij Date: Tue, 15 Nov 2016 10:15:01 +0100 Message-ID: Subject: Re: [PATCH] pinctrl: sunxi: Free configs in pinctrl_map only if it is a config map To: Chen-Yu Tsai Cc: Maxime Ripard , "linux-gpio@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , linux-sunxi Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 11, 2016 at 3:35 AM, Chen-Yu Tsai wrote: > In the recently refactored sunxi pinctrl library, we are only allocating > one set of pin configs for each pinmux setting node. When the pinctrl_map > structure is freed, the pin configs should also be freed. However the > code assumed the first map would contain the configs, which actually > never happens, as the mux function map gets added first. > > The proper way to do this is to look through all the maps and free the > first one whose type is actually PIN_MAP_TYPE_CONFIGS_GROUP. > > Also slightly expand the comment explaining this. > > Fixes: f233dbca6227 ("pinctrl: sunxi: Rework the pin config building code") > Signed-off-by: Chen-Yu Tsai Patch applied with Maxime's ACK. Yours, Linus Walleij