Commit 20720052 authored by SongJingyi's avatar SongJingyi Committed by openeuler-sync-bot
Browse files

ptp_qoriq: fix memory leak in probe()

stable inclusion
from stable-v5.10.177
commit 3907fcb5a439933cf8c10d6dc300bc11eba30de3
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3907fcb5a439933cf8c10d6dc300bc11eba30de3



--------------------------------

[ Upstream commit f3364222 ]

Smatch complains that:
drivers/ptp/ptp_qoriq.c ptp_qoriq_probe()
warn: 'base' from ioremap() not released.

Fix this by revising the parameter from 'ptp_qoriq->base' to 'base'.
This is only a bug if ptp_qoriq_init() returns on the
first -ENODEV error path.
For other error paths ptp_qoriq->base and base are the same.
And this change makes the code more readable.

Fixes: 7f4399ba ("ptp_qoriq: fix NULL access if ptp dt node missing")
Signed-off-by: default avatarSongJingyi <u201912584@hust.edu.cn>
Reviewed-by: default avatarDan Carpenter <error27@gmail.com>
Reviewed-by: default avatarDongliang Mu <dzm91@hust.edu.cn>
Link: https://lore.kernel.org/r/20230324031406.1895159-1-u201912584@hust.edu.cn


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
(cherry picked from commit c916eaa4)
parent 67846b12
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment