diff options
author | Chenyuan Yang <chenyuan0y@gmail.com> | 2025-04-14 15:50:50 +0300 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2025-05-14 11:29:44 +0300 |
commit | d14402a38c2d868cacb1facaf9be908ca6558e59 (patch) | |
tree | 51b65f883019625def4e3df5f6120d1f64e0ce2f /tools/perf/scripts/python | |
parent | e00c9aea31035f46b04a13effaa801f8b3419d2a (diff) | |
download | linux-d14402a38c2d868cacb1facaf9be908ca6558e59.tar.xz |
phy: qcom-qmp-usb: Fix an NULL vs IS_ERR() bug
The qmp_usb_iomap() helper function currently returns the raw result of
devm_ioremap() for non-exclusive mappings. Since devm_ioremap() may return
a NULL pointer and the caller only checks error pointers with IS_ERR(),
NULL could bypass the check and lead to an invalid dereference.
Fix the issue by checking if devm_ioremap() returns NULL. When it does,
qmp_usb_iomap() now returns an error pointer via IOMEM_ERR_PTR(-ENOMEM),
ensuring safe and consistent error handling.
Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Fixes: a5d6b1ac56cb ("phy: qcom-qmp-usb: fix memleak on probe deferral")
CC: Johan Hovold <johan@kernel.org>
CC: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250414125050.2118619-1-chenyuan0y@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions