soundwire: bus: fix device number leak on errors
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 13 Jan 2020 22:56:37 +0000 (16:56 -0600)
committerVinod Koul <vkoul@kernel.org>
Tue, 14 Jan 2020 06:35:52 +0000 (12:05 +0530)
commitfd6a3ac8e87cedd83d6aad4bbc2682a903fb5d01
treee1aeff28f9a2e152fed22f187dbbf99bae740ffe
parent78f6fdd6161f6b5a8fc13b8b0def923437a61a7f
soundwire: bus: fix device number leak on errors

If the programming of the dev_number fails due to an IO error, a new
device_number will be assigned, resulting in a leak.

Make sure we only assign a device_number once per Slave device.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200113225637.17313-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c
include/linux/soundwire/sdw.h