]> git.baikalelectronics.ru Git - kernel.git/commit
bus: fsl-mc: Fix test for end of loop
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 8 Feb 2021 17:09:47 +0000 (19:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Feb 2021 09:56:37 +0000 (10:56 +0100)
commitbffc8750f1013aaf19662a2c9f849e6c4ddce3d8
tree76c4d73970f48ca29f4140443b8ff089c2ce889c
parent84452e8ff14dcac9dc2ab3cb293650ac27504a29
bus: fsl-mc: Fix test for end of loop

The "desc" pointer can't possibly be NULL here.  If we can't find the
correct "desc" then tt points to the last element of the
fsl_mc_accepted_cmds[] array.  Fix this by testing if
"i == FSL_MC_NUM_ACCEPTED_CMDS" instead.

Fixes: 23570840650e ("bus: fsl-mc: add fsl-mc userspace support")
Acked-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210208170949.3070898-2-ciorneiioana@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bus/fsl-mc/fsl-mc-uapi.c