soundwire: intel: fix inversion in devm_kcalloc parameters
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 11 Apr 2019 03:16:57 +0000 (22:16 -0500)
committerVinod Koul <vkoul@kernel.org>
Sun, 14 Apr 2019 10:03:26 +0000 (15:33 +0530)
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 <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/intel.c

index fd8d034cfec1ccf4e432d979555759bbb5f53010..8669b314c4760fdec1dad3165110df9f096e5cef 100644 (file)
@@ -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;