devm_free.cocci (f632a8170a6b667ee4e3f552087588f0fe13c4bb) | devm_free.cocci (fe34c89d25429e079ba67416529514120dd715f8) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/// Find uses of standard freeing functons on values allocated using devm_ 3/// functions. Values allocated using the devm_functions are freed when 4/// the device is detached, and thus the use of the standard freeing 5/// function would cause a double free. | 1// SPDX-License-Identifier: GPL-2.0-only 2/// Find uses of standard freeing functons on values allocated using devm_ 3/// functions. Values allocated using the devm_functions are freed when 4/// the device is detached, and thus the use of the standard freeing 5/// function would cause a double free. |
6/// See Documentation/driver-model/devres.rst for more information. | 6/// See Documentation/driver-api/driver-model/devres.rst for more information. |
7/// 8/// A difficulty of detecting this problem is that the standard freeing 9/// function might be called from a different function than the one 10/// containing the allocation function. It is thus necessary to make the 11/// connection between the allocation function and the freeing function. 12/// Here this is done using the specific argument text, which is prone to 13/// false positives. There is no rule for the request_region and 14/// request_mem_region variants because this heuristic seems to be a bit --- 137 unchanged lines hidden --- | 7/// 8/// A difficulty of detecting this problem is that the standard freeing 9/// function might be called from a different function than the one 10/// containing the allocation function. It is thus necessary to make the 11/// connection between the allocation function and the freeing function. 12/// Here this is done using the specific argument text, which is prone to 13/// false positives. There is no rule for the request_region and 14/// request_mem_region variants because this heuristic seems to be a bit --- 137 unchanged lines hidden --- |