• Wen Yang's avatar
    soc/fsl/qe: fix err handling of ucc_of_parse_tdm · 0962699e
    Wen Yang authored
    [ Upstream commit 8d68100a ]
    
    Currently there are some issues with the ucc_of_parse_tdm function:
    1, a possible null pointer dereference in ucc_of_parse_tdm,
    detected by the semantic patch deref_null.cocci,
    with the following warning:
    drivers/soc/fsl/qe/qe_tdm.c:177:21-24: ERROR: pdev is NULL but dereferenced.
    2, dev gets modified, so in any case that devm_iounmap() will fail
    even when the new pdev is valid, because the iomap was done with a
     different pdev.
    3, there is no driver bind with the "fsl,t1040-qe-si" or
    "fsl,t1040-qe-siram" device. So allocating resources using devm_*()
    with these devices won't provide a cleanup path for these resources
    when the caller fails.
    
    This patch fixes them.
    Suggested-by: 's avatarLi Yang <leoyang.li@nxp.com>
    Suggested-by: 's avatarChristophe LEROY <christophe.leroy@c-s.fr>
    Signed-off-by: 's avatarWen Yang <wen.yang99@zte.com.cn>
    Reviewed-by: 's avatarPeng Hao <peng.hao2@zte.com.cn>
    CC: Julia Lawall <julia.lawall@lip6.fr>
    CC: Zhao Qiang <qiang.zhao@nxp.com>
    CC: David S. Miller <davem@davemloft.net>
    CC: netdev@vger.kernel.org
    CC: linuxppc-dev@lists.ozlabs.org
    CC: linux-kernel@vger.kernel.org
    Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
    0962699e
Name
Last commit
Last update
..
actions Loading commit data...
amlogic Loading commit data...
atmel Loading commit data...
bcm Loading commit data...
dove Loading commit data...
fsl Loading commit data...
gemini Loading commit data...
imx Loading commit data...
lantiq Loading commit data...
mediatek Loading commit data...
qcom Loading commit data...
renesas Loading commit data...
rockchip Loading commit data...
samsung Loading commit data...
sunxi Loading commit data...
tegra Loading commit data...
ti Loading commit data...
ux500 Loading commit data...
versatile Loading commit data...
xilinx Loading commit data...
zte Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...