Message ID | 20250116-qcom-ice-fix-dev-leak-v1-4-84d937683790@linaro.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | soc: qcom: ice: fix dev reference leaked through of_qcom_ice_get | expand |
On 16/01/2025 15:49, Tudor Ambarus wrote: > -EXPORT_SYMBOL_GPL(of_qcom_ice_get); > > static void qcom_ice_put(const struct qcom_ice *ice) > { > diff --git a/include/soc/qcom/ice.h b/include/soc/qcom/ice.h > index d5f6a228df65..fdf1b5c21eb9 100644 > --- a/include/soc/qcom/ice.h > +++ b/include/soc/qcom/ice.h > @@ -33,7 +33,6 @@ int qcom_ice_program_key(struct qcom_ice *ice, > const u8 crypto_key[], u8 data_unit_size, > int slot); > int qcom_ice_evict_key(struct qcom_ice *ice, int slot); > -struct qcom_ice *of_qcom_ice_get(struct device *dev); > struct qcom_ice *devm_of_qcom_ice_get(struct device *dev); So this explains why you did not export the put(). Mention the reason for missing put() in the first commit. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof
diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c index 9cdf0acba6d1..1a2f77cc7175 100644 --- a/drivers/soc/qcom/ice.c +++ b/drivers/soc/qcom/ice.c @@ -262,7 +262,7 @@ static struct qcom_ice *qcom_ice_create(struct device *dev, * Return: ICE pointer on success, NULL if there is no ICE data provided by the * consumer or ERR_PTR() on error. */ -struct qcom_ice *of_qcom_ice_get(struct device *dev) +static struct qcom_ice *of_qcom_ice_get(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct qcom_ice *ice; @@ -323,7 +323,6 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev) return ice; } -EXPORT_SYMBOL_GPL(of_qcom_ice_get); static void qcom_ice_put(const struct qcom_ice *ice) { diff --git a/include/soc/qcom/ice.h b/include/soc/qcom/ice.h index d5f6a228df65..fdf1b5c21eb9 100644 --- a/include/soc/qcom/ice.h +++ b/include/soc/qcom/ice.h @@ -33,7 +33,6 @@ int qcom_ice_program_key(struct qcom_ice *ice, const u8 crypto_key[], u8 data_unit_size, int slot); int qcom_ice_evict_key(struct qcom_ice *ice, int slot); -struct qcom_ice *of_qcom_ice_get(struct device *dev); struct qcom_ice *devm_of_qcom_ice_get(struct device *dev); #endif /* __QCOM_ICE_H__ */
There's no consumer calling it left, make the method static. Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org> --- drivers/soc/qcom/ice.c | 3 +-- include/soc/qcom/ice.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-)