From: Tejun Heo Date: Wed, 31 May 2017 18:26:26 +0000 (-0400) Subject: libata: fix error checking in in ata_parse_force_one() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f7cf69ae171592d133c69b9adaa5de7cfb6038ea;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reported-by: Petru-Florin Mihancea Link: https://bugzilla.kernel.org/show_bug.cgi?id=195785 --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 2d83b8c75965..e157a0e44419 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -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; }