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=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 7A863C10F14 for ; Thu, 11 Apr 2019 08:44:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 552142184B for ; Thu, 11 Apr 2019 08:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727185AbfDKIn7 (ORCPT ); Thu, 11 Apr 2019 04:43:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:34268 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727127AbfDKIn5 (ORCPT ); Thu, 11 Apr 2019 04:43:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5F9FEAD65; Thu, 11 Apr 2019 08:43:56 +0000 (UTC) Date: Thu, 11 Apr 2019 10:43:56 +0200 Message-ID: From: Takashi Iwai To: Pierre-Louis Bossart Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, broonie@kernel.org, vkoul@kernel.org, gregkh@linuxfoundation.org, liam.r.girdwood@linux.intel.com, jank@cadence.com, joe@perches.com, srinivas.kandagatla@linaro.org, Sanyog Kale Subject: Re: [PATCH v3 1/5] soundwire: intel: fix inversion in devm_kcalloc parameters In-Reply-To: <20190411031701.5926-2-pierre-louis.bossart@linux.intel.com> References: <20190411031701.5926-1-pierre-louis.bossart@linux.intel.com> <20190411031701.5926-2-pierre-louis.bossart@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 Apr 2019 05:16:57 +0200, Pierre-Louis Bossart wrote: > > the number of elements and size are inverted, fix. > > This probably only worked because the number of properties is > hard-coded to 1. Well, both are mathematically equivalent :) Takashi > > Fixes: 71bb8a1b059e ('soundwire: intel: Add Intel Master driver') > Signed-off-by: Pierre-Louis Bossart > --- > drivers/soundwire/intel.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c > index fd8d034cfec1..8669b314c476 100644 > --- a/drivers/soundwire/intel.c > +++ b/drivers/soundwire/intel.c > @@ -796,8 +796,8 @@ static int intel_prop_read(struct sdw_bus *bus) > > /* BIOS is not giving some values correctly. So, lets override them */ > bus->prop.num_freq = 1; > - bus->prop.freq = devm_kcalloc(bus->dev, sizeof(*bus->prop.freq), > - bus->prop.num_freq, GFP_KERNEL); > + bus->prop.freq = devm_kcalloc(bus->dev, bus->prop.num_freq, > + sizeof(*bus->prop.freq), GFP_KERNEL); > if (!bus->prop.freq) > return -ENOMEM; > > -- > 2.17.1 >