Commit f9f4be67 authored by Tejun Heo's avatar Tejun Heo Committed by Greg Kroah-Hartman

libata: fix error checking in in ata_parse_force_one()

[ Upstream commit f7cf69ae ]

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: default avatarTejun Heo <tj@kernel.org>
Reported-by: default avatarPetru-Florin Mihancea <petrum@gmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=195785Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent fd500b35
...@@ -6781,7 +6781,7 @@ static int __init ata_parse_force_one(char **cur, ...@@ -6781,7 +6781,7 @@ static int __init ata_parse_force_one(char **cur,
} }
force_ent->port = simple_strtoul(id, &endp, 10); force_ent->port = simple_strtoul(id, &endp, 10);
if (p == endp || *endp != '\0') { if (id == endp || *endp != '\0') {
*reason = "invalid port/link"; *reason = "invalid port/link";
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment