Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4615923rwd; Tue, 23 May 2023 09:58:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7/Sj3HhTorQQ6QnPFVvc/dJ5exNzTmcd7xrIhgLMBUQBD6kzLXN4mumlOCTpgFurgyH93R X-Received: by 2002:a05:6a00:24ca:b0:64a:ede1:13fb with SMTP id d10-20020a056a0024ca00b0064aede113fbmr20349511pfv.9.1684861113957; Tue, 23 May 2023 09:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684861113; cv=none; d=google.com; s=arc-20160816; b=novwi+cA+fWtZ1T8hVxYfrWCGWLWq29eh1sQ4Eox6VU/908EF0eTJTPHB1x8hXvr3Z 06Q9POpFpIo2hG8o4P8npOWS8jTR58/5+xOEJMAz1oW1MkL1K2WtlUElwW53fXe42Lgi TnT507Io92k/x7Xcm4ZibW8DhXTRJR3NbK2r9vUHS/waj2kAdeLx0Ra5uLSpepqxd7ls xs+z/dHhqI/QPZz893t6SWsfzdc1h7udoKiTO9VxV6MtsqfDiNbRpN1aHi9NX6SlLMy6 I3oVAQ6ugrct2/5GL4X+0pqrHxZFtF49tsNXnr/iHV1lze2tW36oH2MfaKJ57XIB8Ran OTDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=5yF9nOj09HTDzQnnP276r9c0RCVJ1EZ0hYQ6HsZx7MQ=; b=Qw61bsSEAklNoG8nRl8Okdxvohe9xmiaEmRuNosQFrY11sY0x3eq143MHA7E8E0mlZ ISrNMj9cYsEUXsHXjqe5O4HKSGHU19YRuAopedfKXHdnXD177tT4IXIIUIScRvZe2ihx +wuyrfsrzJgOAYpLAe5pi0wA3H8qolJbStaA3dDoLXlBEgUx4eyWuAbVuwnjSumDz4WB 5n/PedejyBeFU98UbLaef4meI9Ldc9fXQZqYOrlDTLTRp3UVsCtsJURZw2h2oFWaP9M3 C55/uLYq/640vv5WfLBTELhkFyxe1a2qykjHjG2p560iEUmElkUppsa8/pc8taAP3NSa gfPA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k186-20020a6284c3000000b0064d109bad99si5026230pfd.29.2023.05.23.09.58.19; Tue, 23 May 2023 09:58:33 -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; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237716AbjEWQnG (ORCPT + 99 others); Tue, 23 May 2023 12:43:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjEWQnF (ORCPT ); Tue, 23 May 2023 12:43:05 -0400 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17A9719B for ; Tue, 23 May 2023 09:42:51 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id d9d7e6b2-f988-11ed-b3cf-005056bd6ce9; Tue, 23 May 2023 19:42:49 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Tue, 23 May 2023 19:42:48 +0300 To: Wells Lu Cc: linus.walleij@linaro.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, wells.lu@sunplus.com Subject: Re: [PATCH] pinctrl:sunplus: Add check for kmalloc Message-ID: References: <1684836688-9204-1-git-send-email-wellslutw@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1684836688-9204-1-git-send-email-wellslutw@gmail.com> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, May 23, 2023 at 06:11:28PM +0800, Wells Lu kirjoitti: > Fix Smatch static checker warning: > potential null dereference 'configs'. (kmalloc returns null) ... > configs = kmalloc(sizeof(*configs), GFP_KERNEL); > + if (!configs) > + return -ENOMEM; "Fixing" by adding a memory leak is not probably a good approach. ... > configs = kmalloc(sizeof(*configs), GFP_KERNEL); > + if (!configs) > + return -ENOMEM; Ditto. ... It might be that I'm mistaken. In this case please add an explanation why in the commit message. -- With Best Regards, Andy Shevchenko