]> git.baikalelectronics.ru Git - kernel.git/commit
staging: fsl-mc/dpio: Fix incorrect comparison
authorIoana Radulescu <ruxandra.radulescu@nxp.com>
Thu, 28 Sep 2017 14:10:33 +0000 (09:10 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Oct 2017 16:34:56 +0000 (18:34 +0200)
commit9d7fc1ebc5ec6e77a9f3347110b1207d57a0c87f
tree41177623a4daa6077ab20bfdbc1c9725002a4228
parent99d342baa23b104ad0a207a0e7b532da13d2892b
staging: fsl-mc/dpio: Fix incorrect comparison

For some dpio functions, a cpu id parameter value of -1 is
valid and means "any". But when trying to validate this param
value against an upper limit, in this case num_possible_cpus(),
we risk obtaining the wrong result due to an implicit cast.

Avoid an incorrect check result by explicitly comparing the
cpu id with the "any" value before verifying the upper bound.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-mc/bus/dpio/dpio-service.c
drivers/staging/fsl-mc/include/dpaa2-io.h