mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
libata: fix error checking in in ata_parse_force_one()
[ Upstream commit f7cf69ae17 ]
ata_parse_force_one() was incorrectly comparing @p to @endp when it
should have been comparing @id. The only consequence is that it may
end up using an invalid port number in "libata.force" module param
instead of rejecting it.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Petru-Florin Mihancea <petrum@gmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=195785
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
fd500b357b
commit
f9f4be67be
@@ -6781,7 +6781,7 @@ static int __init ata_parse_force_one(char **cur,
|
||||
}
|
||||
|
||||
force_ent->port = simple_strtoul(id, &endp, 10);
|
||||
if (p == endp || *endp != '\0') {
|
||||
if (id == endp || *endp != '\0') {
|
||||
*reason = "invalid port/link";
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user