Skip to content

Commit f7cf69a

Browse files
committed
libata: fix error checking in in ata_parse_force_one()
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
1 parent 3e4240d commit f7cf69a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ata/libata-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6800,7 +6800,7 @@ static int __init ata_parse_force_one(char **cur,
68006800
}
68016801

68026802
force_ent->port = simple_strtoul(id, &endp, 10);
6803-
if (p == endp || *endp != '\0') {
6803+
if (id == endp || *endp != '\0') {
68046804
*reason = "invalid port/link";
68056805
return -EINVAL;
68066806
}

0 commit comments

Comments
 (0)