]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
drm/msm/dsi: invalid parameter check in msm_dsi_phy_enable
authorJosé Expósito <jose.exposito89@gmail.com>
Sun, 16 Jan 2022 18:18:44 +0000 (19:18 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 3 Feb 2022 09:28:51 +0000 (10:28 +0100)
commit96a2b0a1decbef68f9004c26e24969adab7c6c4f
treefc3e62d2d3365d9fb4f236a7da1aee1a1083198b
parentbfe10336b5c3a9cb9f266c572f414dbb6b7bf9cc
drm/msm/dsi: invalid parameter check in msm_dsi_phy_enable

BugLink: https://bugs.launchpad.net/bugs/1959879
commit 5e761a2287234bc402ba7ef07129f5103bcd775c upstream.

The function performs a check on the "phy" input parameter, however, it
is used before the check.

Initialize the "dev" variable after the sanity check to avoid a possible
NULL pointer dereference.

Fixes: 5c8290284402b ("drm/msm/dsi: Split PHY drivers to separate files")
Addresses-Coverity-ID: 1493860 ("Null pointer dereference")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20220116181844.7400-1-jose.exposito89@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c