qcacld-3.0: Correct the logic that checks bound for pmo handler ids

Under unregistering of PMO handlers, incoming component id is sanity
checked. In the logic, WLAN_UMAC_MAX_COMPONENTS as id will not cause
failure even though it is an id beyond the acceptable bound.

Correct the logic so that WLAN_UMAC_MAX_COMPONENTS ends up in failure.

Change-Id: I6935f34c6d91a4217c3f7f73cd5539af2741ed2b
CRs-Fixed: 2091831
这个提交包含在:
Nachiket Kukade
2018-01-04 20:31:01 +05:30
提交者 snandini
父节点 e807596178
当前提交 da14496747

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -370,7 +370,7 @@ QDF_STATUS pmo_unregister_suspend_handler(
goto out;
}
if (id > WLAN_UMAC_MAX_COMPONENTS || id < 0) {
if (id >= WLAN_UMAC_MAX_COMPONENTS || id < 0) {
pmo_err("component id: %d is %s then valid components id",
id, id < 0 ? "Less" : "More");
status = QDF_STATUS_E_FAILURE;