Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2163517iof; Tue, 7 Jun 2022 21:52:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCIMEKTdbHrXoVWaO0011zfF+oQgH87chYgokFBYG9uJmZHBp6pbs/juLbiz5R+kPDhxD/ X-Received: by 2002:a17:903:20d1:b0:168:93b6:a957 with SMTP id i17-20020a17090320d100b0016893b6a957mr1826433plb.156.1654663944510; Tue, 07 Jun 2022 21:52:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654663944; cv=none; d=google.com; s=arc-20160816; b=wdY0ZjKf2BMrgIovdDuKiKzZhL6anxZXP8D0CiH/SUXiCF1kSxTSp937btFqvujS59 lwfeVZaJHc7i49sqtssOxazxQaMyJP3n2CD42aJ7Guzc0l1TrlUFBlJMiRXfqDxOI10b 7ZE+Gqe8+x9/BG/LOgB8w5wzsqqI8lgRBuf4vW5MDtgYbb6M9QA7J005Pob5+meP+Ao2 TrwqTqbyIrFtPx5Z87I4dv0wODMVmAXQPXRBbgFmbYBY1bS74QVSdX4i4EjX/2GDZRR+ lskbX7fhxp8OfZACTMw8scluYBHcZI0w4LgWZuSWy2AOEBpQ9gHUC0SEdv89J2Svl4my fmIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CNiyyDj88jvQw4EklItQxE3p08L7Dnh+mE6iTzVJJh8=; b=hOhmCO6pMsfw01U+1LdICPYTYB/S1aTz1UM7UhKU0GVYJUYip7bnHWvbRgGTh/vNmW i91hUN6RV1eoU/0tymc2d52Kwu6BATIAW0M2kOxwY+cL1vHq8kit1AWT8Cuxd5dtaKq2 JoXOQ73WZ51bWxmcz9SZEFTqFAF1CcVIeajjNiF8WEhqosTJrBklPg2VAZK0Lk2oAY7K GovVHFSFNxhf0UFKKMDFaMdxxYPhno18ta6AB9YAJRDe23Fd3dhO2J1GxGyTqvfghANE YKhN8ij+pRTNIg1WwatzlKj+KTuhMK1tcxGdp/0VLIm3g56/MiKo5+Vt8xtX8Sw1oChB 4aUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hhiuzj1I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id pj7-20020a17090b4f4700b001e33cfa3116si31642111pjb.109.2022.06.07.21.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:52:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hhiuzj1I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1008625289; Tue, 7 Jun 2022 21:21:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378449AbiFGV1X (ORCPT + 99 others); Tue, 7 Jun 2022 17:27:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377637AbiFGUdz (ORCPT ); Tue, 7 Jun 2022 16:33:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91C94137C43; Tue, 7 Jun 2022 11:35:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A2D886156D; Tue, 7 Jun 2022 18:35:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1D18C385A2; Tue, 7 Jun 2022 18:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654626934; bh=ozUGUxXjZ0SLqJrR+0taUaj3gF28+ijUtxbb/5RCXvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hhiuzj1IF8LkZZ3AY76YBVB8Y0vm3lFaOGU28vC5ePsltHD62v3E1vns4ib6xOjyv a6Or/SoHYmLS73yhr2gqdfC4ygDgV7YSJPzbvzsDNF+w5xYzm5uK5MX1BhQof6oz+c wc5XDDD9bP6bJJZdLmzlla5q2KKPbe9Qbl0JYdVI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 5.17 555/772] gpio: sim: Use correct order for the parameters of devm_kcalloc() Date: Tue, 7 Jun 2022 19:02:27 +0200 Message-Id: <20220607165005.314733506@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164948.980838585@linuxfoundation.org> References: <20220607164948.980838585@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 From: Christophe JAILLET [ Upstream commit c680c6a814a2269427fad9ac417ab16756bceae9 ] We should have 'n', then 'size', not the opposite. This is harmless because the 2 values are just multiplied, but having the correct order silence a (unpublished yet) smatch warning. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Christophe JAILLET Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- drivers/gpio/gpio-sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index 41c31b10ae84..98109839102f 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -314,8 +314,8 @@ static int gpio_sim_setup_sysfs(struct gpio_sim_chip *chip) for (i = 0; i < num_lines; i++) { attr_group = devm_kzalloc(dev, sizeof(*attr_group), GFP_KERNEL); - attrs = devm_kcalloc(dev, sizeof(*attrs), - GPIO_SIM_NUM_ATTRS, GFP_KERNEL); + attrs = devm_kcalloc(dev, GPIO_SIM_NUM_ATTRS, sizeof(*attrs), + GFP_KERNEL); val_attr = devm_kzalloc(dev, sizeof(*val_attr), GFP_KERNEL); pull_attr = devm_kzalloc(dev, sizeof(*pull_attr), GFP_KERNEL); if (!attr_group || !attrs || !val_attr || !pull_attr) -- 2.35.1