Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1483368rwd; Thu, 25 May 2023 13:20:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60+xe5UZq480sE9puw7S2lLdvefs2SglVP3PxAwfbWC6sCqNKl6cSD7BtpAcoRnZuWs6O4 X-Received: by 2002:a05:6a20:841c:b0:10b:cf0a:f826 with SMTP id c28-20020a056a20841c00b0010bcf0af826mr17426330pzd.46.1685046017263; Thu, 25 May 2023 13:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685046017; cv=none; d=google.com; s=arc-20160816; b=S75emuMb++HJjt44IdF1muqYD0LOHmZ2q1GIlOQyM7FEl5cX6lNGwaI5IZSZUkv8o5 3Kvr34LlqjO4Tx7FpPtkjNedwn9MzDuKiUNQWATEra0h6Lo0dC9hdUv84UGrVFPrSYFE +E7BLBwTXI91U5hRm25210tNV7+ybonTEh4oixpB3E/wtuQvfEpNV1RURCjAZ7XpUAqK U8mRdv+h3cd60xd9LK5kL39nWRrS5iGf639kptCyNuOIPB/xzq8Vv228yOASCbw1GfKW AIv81MNZB8aQPXo5HfuFfN4YKjhMqhPC7xH0BKIPAHq0ZF3kSHGFNmjjC7qENXftk4lD q9cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Nn++8Gtv+O3RQJEDu5H3rgKwGw3s8JlnntA9IjlyTMI=; b=klo1/+g7NhZKFjdEvdbHH/47KZCcDrqX8WbATn98Ca3CvVTEELDxhDk2CyQdAN1LWF zbdqW1fHCaXX7/n4O6WdzXUQkn5JdMYKhGdMGR5BkDZdldct4X9K/GYZNSVkRrmAqh9U Ni/+Pc7Q3YLlP2MbAvM2KnVk5PNr9o+XpyVcK3RcP5gI7va7JlkLzBOswgzDsSGnwf3s YAyIeGTtJR8pfTQGySc+NY7ju0s3+H3fB8MlZt8ixnw4MeUl9jalru9DHmgAeoosWHjE zEgMHI+jlQxPGvtiSMyXld0Mih3HyjBumY7v3zUpdBrzAbqSGWDYR3BT73gQWM9gDRFc 7lIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=KRMcaq3e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a6566d4000000b0051f179c48e7si1892508pgw.866.2023.05.25.13.20.02; Thu, 25 May 2023 13:20:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=KRMcaq3e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbjEYUAr (ORCPT + 99 others); Thu, 25 May 2023 16:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242131AbjEYUAm (ORCPT ); Thu, 25 May 2023 16:00:42 -0400 Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E722B95 for ; Thu, 25 May 2023 13:00:37 -0700 (PDT) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 2H8UqmnigZO7A2H8UqejSu; Thu, 25 May 2023 22:00:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1685044836; bh=Nn++8Gtv+O3RQJEDu5H3rgKwGw3s8JlnntA9IjlyTMI=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=KRMcaq3eKxGPDnANHauSBiLaw1EsdjNG32425HNmPXaWwYupyiGT8nkgmIZTIwR3L ZjZYywM2TvTPEvm4oXOgi55tmcGCX8UUJtOoiY6Yuma6kXfyinQucit7AtC5RXpRPV pOyzkHzu5OmsY0a5wuduCD6+yDNAj4dv/jOlUFtm5XfRugeRTaYHRoRmfiVt6pjUSr nQNEghRoLZiHOBrBHUBl4QkXWzmIdejBNADt4ZRlO3aRC6j1cuq43gJUCl8NpMFI0c YJ7P/ELhrJVqoKm+/EGmOzfWoU6CLHFHkVtr5CVdcox2XxZZ+QoTSfrGPiG9OUbA5Q JC86PF81cfjGg== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 25 May 2023 22:00:36 +0200 X-ME-IP: 86.243.2.178 Message-ID: <381c7339-685c-8973-ecf2-5a34cd18cda3@wanadoo.fr> Date: Thu, 25 May 2023 22:00:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] pinctrl:sunplus: Add check for kmalloc Content-Language: fr, en-US To: Dan Carpenter Cc: andy.shevchenko@gmail.com, =?UTF-8?B?V2VsbHMgTHUg5ZGC6Iqz6aiw?= , Wells Lu , "linus.walleij@linaro.org" , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1684836688-9204-1-git-send-email-wellslutw@gmail.com> <1560e9c0e5154802ab020b9da846d65f@sphcmbx02.sunplus.com.tw> <9f937bde-c908-4941-b65c-e4c303d3acae@kili.mountain> From: Christophe JAILLET In-Reply-To: <9f937bde-c908-4941-b65c-e4c303d3acae@kili.mountain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 25/05/2023 à 21:19, Dan Carpenter a écrit : > On Tue, May 23, 2023 at 10:05:49PM +0200, Christophe JAILLET wrote: >> Should be looked at more carefully, but >> dt_to_map_one_config (in /drivers/pinctrl/devicetree.c) >> .dt_node_to_map >> --> sppctl_dt_node_to_map >> >> Should dt_to_map_one_config() fail, pinctrl_dt_free_maps() is called >> (see https://elixir.bootlin.com/linux/v6.4-rc1/source/drivers/pinctrl/devicetree.c#L281) > > Thanks for this call tree, I don't have this file enabled in my build > so it's not easy for me to find how sppctl_dt_node_to_map() was called. > > drivers/pinctrl/devicetree.c > 160 dev_err(p->dev, "pctldev %s doesn't support DT\n", > 161 dev_name(pctldev->dev)); > 162 return -ENODEV; > 163 } > 164 ret = ops->dt_node_to_map(pctldev, np_config, &map, &num_maps); > ^^^^ > "map" isn't stored anywhere so it will be leaked. I guess kmemleak > already figured this out. > > 165 if (ret < 0) > 166 return ret; > 167 else if (num_maps == 0) { > 168 /* > Hi, thanks Dan for sharing your PoV on this. CJ