Skip to content

Commit

Permalink
libata: fix error checking in in ata_parse_force_one()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Petru-Florin Mihancea <[email protected]>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=195785
  • Loading branch information
htejun committed May 31, 2017
1 parent 3e4240d commit f7cf69a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -6800,7 +6800,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;
}
Expand Down

0 comments on commit f7cf69a

Please sign in to comment.