diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2020-09-25 12:55:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-29 11:55:12 +0300 |
commit | 43f146dc16e5bb54fa4995600289e4b165f8bfbd (patch) | |
tree | aa0811d23fa67a3eb9951798b087ee1850e64a15 /drivers/slimbus | |
parent | a114d642aff8d47ca6cf70431e1983c22a94a899 (diff) | |
download | linux-43f146dc16e5bb54fa4995600289e4b165f8bfbd.tar.xz |
slimbus: core: check get_addr before removing laddr ida
[ Upstream commit f97769fde678e111a1b7b165b380d8a3dfe54f4e ]
logical address can be either assigned by the SLIMBus controller or the core.
Core uses IDA in cases where get_addr callback is not provided by the
controller.
Core already has this check while allocating IDR, however during absence
reporting this is not checked. This patch fixes this issue.
Fixes: 46a2bb5a7f7e ("slimbus: core: Add slim controllers support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200925095520.27316-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/slimbus')
-rw-r--r-- | drivers/slimbus/core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c index 943172806a8a..6e690aaacad1 100644 --- a/drivers/slimbus/core.c +++ b/drivers/slimbus/core.c @@ -297,8 +297,8 @@ void slim_report_absent(struct slim_device *sbdev) mutex_lock(&ctrl->lock); sbdev->is_laddr_valid = false; mutex_unlock(&ctrl->lock); - - ida_simple_remove(&ctrl->laddr_ida, sbdev->laddr); + if (!ctrl->get_laddr) + ida_simple_remove(&ctrl->laddr_ida, sbdev->laddr); slim_device_update_status(sbdev, SLIM_DEVICE_STATUS_DOWN); } EXPORT_SYMBOL_GPL(slim_report_absent); |