From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FEB7C47092 for ; Wed, 2 Jun 2021 22:19:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6BED1613DE for ; Wed, 2 Jun 2021 22:19:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbhFBWVF (ORCPT ); Wed, 2 Jun 2021 18:21:05 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:60257 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229541AbhFBWVF (ORCPT ); Wed, 2 Jun 2021 18:21:05 -0400 Date: 03 Jun 2021 07:19:20 +0900 X-IronPort-AV: E=Sophos;i="5.83,244,1616425200"; d="scan'208";a="83233837" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 03 Jun 2021 07:19:20 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 58D4740F9B99; Thu, 3 Jun 2021 07:19:20 +0900 (JST) Message-ID: <87im2vj4ev.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Dan Carpenter Cc: Colin King , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] ASoC: rsnd: check for zero node count In-Reply-To: <20210602112135.GF1955@kadam> References: <20210602103722.12128-1-colin.king@canonical.com> <20210602112135.GF1955@kadam> User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi > > From: Colin Ian King > > > > The call to rsnd_node_count can potentially return a zero node count > > so add a check for this corner case. (Note that the two other calls > > to rsnd_node_count in the kernel perform this check, so I think it > > justifies adding this). This avoids using a zero nr in a devm_kcalloc > > call. > > I don't have a problem with the patch, but really the code works fine > as is. A better commit message is: > > Most callers of_get_child_count() check that "nr" is non-zero so it > causes a static checker warning when we don't do that here. This > doesn't cause a problem or a crash, but having zero SSUIes (What's > plural of ssui?) doesn't make sense either so let's add a check. For the code Acked-by: Kuninori Morimoto Thank you for your help !! Best regards --- Kuninori Morimoto