]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: ufs: qcom: fix dev reference leaked through of_qcom_ice_get
authorTudor Ambarus <tudor.ambarus@linaro.org>
Fri, 17 Jan 2025 14:18:52 +0000 (14:18 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:50:41 +0000 (07:50 +0200)
[ Upstream commit ded40f32b55f7f2f4ed9627dd3c37a1fe89ed8c6 ]

The driver leaks the device reference taken with
of_find_device_by_node(). Fix the leak by using devm_of_qcom_ice_get().

Fixes: 56541c7c4468 ("scsi: ufs: ufs-qcom: Switch to the new ICE API")
Cc: stable@vger.kernel.org
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com> # SCSI
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20250117-qcom-ice-fix-dev-leak-v2-3-1ffa5b6884cb@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ufs/host/ufs-qcom.c

index 51ed40529f9a7b0fab8bad7ea41a76c3356f78d6..c6417ef074a478e87adfe8120bc9cca35e879441 100644 (file)
@@ -121,7 +121,7 @@ static int ufs_qcom_ice_init(struct ufs_qcom_host *host)
        struct device *dev = hba->dev;
        struct qcom_ice *ice;
 
-       ice = of_qcom_ice_get(dev);
+       ice = devm_of_qcom_ice_get(dev);
        if (ice == ERR_PTR(-EOPNOTSUPP)) {
                dev_warn(dev, "Disabling inline encryption support\n");
                ice = NULL;