]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ptp: ocp: Fix error handling in ptp_ocp_device_init
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Fri, 22 Sep 2023 09:40:44 +0000 (17:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Oct 2023 19:59:07 +0000 (21:59 +0200)
commitcb145e6c2070b6b0ca3ca42902527dd743700fcc
tree956cdc557a1e224546d33950cc25738ae497ee13
parentcd1189956393bf850b2e275e37411855d3bd86bb
ptp: ocp: Fix error handling in ptp_ocp_device_init

[ Upstream commit caa0578c1d487d39e4bb947a1b4965417053b409 ]

When device_add() fails, ptp_ocp_dev_release() will be called
after put_device(). Therefore, it seems that the
ptp_ocp_dev_release() before put_device() is redundant.

Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the timecard.")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Vadim Feodrenko <vadim.fedorenko@linux.dev>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ptp/ptp_ocp.c