slimbus: core: check get_addr before removing laddr ida
[ Upstream commit5.4-rM2-2.2.x-imx-squashedf97769fde6
] 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:46a2bb5a7f
("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>
parent
b7e2b1fe04
commit
9da3ff3368
|
@ -327,8 +327,8 @@ void slim_report_absent(struct slim_device *sbdev)
|
||||||
mutex_lock(&ctrl->lock);
|
mutex_lock(&ctrl->lock);
|
||||||
sbdev->is_laddr_valid = false;
|
sbdev->is_laddr_valid = false;
|
||||||
mutex_unlock(&ctrl->lock);
|
mutex_unlock(&ctrl->lock);
|
||||||
|
if (!ctrl->get_laddr)
|
||||||
ida_simple_remove(&ctrl->laddr_ida, sbdev->laddr);
|
ida_simple_remove(&ctrl->laddr_ida, sbdev->laddr);
|
||||||
slim_device_update_status(sbdev, SLIM_DEVICE_STATUS_DOWN);
|
slim_device_update_status(sbdev, SLIM_DEVICE_STATUS_DOWN);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(slim_report_absent);
|
EXPORT_SYMBOL_GPL(slim_report_absent);
|
||||||
|
|
Loading…
Reference in New Issue