aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strncpy.c
diff options
context:
space:
mode:
authorVaradarajan Narayanan <[email protected]>2023-09-07 12:20:52 +0530
committerVinod Koul <[email protected]>2023-09-21 16:18:22 +0200
commitecec1de5c58f8f3ab6959fcf8d68752eeb65311d (patch)
tree37c3ba322fbe6b646608d2aa5390d2ee3333bbbc /lib/test_fortify/write_overflow-strncpy.c
parent6ee8a9a772b5abd9a9791123ca7aee2dbf126d5f (diff)
phy: qcom: m31: Remove unwanted qphy->vreg is NULL check
Fix the following Smatch complaint: drivers/phy/qualcomm/phy-qcom-m31.c:175 m31usb_phy_init() warn: variable dereferenced before check 'qphy->vreg' (see line 167) drivers/phy/qualcomm/phy-qcom-m31.c 166 167 ret = regulator_enable(qphy->vreg); ^^^^^^^^^^ Unchecked dereference 168 if (ret) { 169 dev_err(&phy->dev, "failed to enable regulator, %d\n", ret); 170 return ret; 171 } 172 173 ret = clk_prepare_enable(qphy->clk); 174 if (ret) { 175 if (qphy->vreg) ^^^^^^^^^^ Checked too late 176 regulator_disable(qphy->vreg); 177 dev_err(&phy->dev, "failed to enable cfg ahb clock, %d\n", ret); Since the phy will not get registered if qphy->vreg is NULL, this check is not needed. Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/linux-phy/[email protected]/T/#u Fixes: 08e49af50701 ("phy: qcom: Introduce M31 USB PHY driver") Signed-off-by: Varadarajan Narayanan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy.c')
0 files changed, 0 insertions, 0 deletions