From: Pierre-Louis Bossart Date: Thu, 11 Apr 2019 03:16:57 +0000 (-0500) Subject: soundwire: intel: fix inversion in devm_kcalloc parameters X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4ac5627acc3e32c6a2acf5d570efc998792f2a65;p=openwrt%2Fstaging%2Fblogic.git soundwire: intel: fix inversion in devm_kcalloc parameters the number of elements and size are inverted, fix. This probably only worked because the number of properties is hard-coded to 1. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Takashi Iwai Signed-off-by: Vinod Koul --- 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;