of/irq: Fix of_irq_parse_one() returned error codes
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 17 Mar 2015 22:21:32 +0000 (00:21 +0200)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 17 Apr 2015 00:11:42 +0000 (20:11 -0400)
commit225d923571dfcb1112d33990d788ef90dd758ea6
tree0ca73462c0c7a53fc2827b3a7932e52ba07a0018
parent542a92093ea9801c9016a9b390dfd223e0bcb3cf
of/irq: Fix of_irq_parse_one() returned error codes

[ Upstream commit d7c146053dd195b90c79b9b8131431f44541d015 ]

The error code paths that require cleanup use a goto to jump to the
cleanup code and return an error code. However, the error code variable
res, which is initialized to -EINVAL when declared, is then overwritten
with the return value of of_parse_phandle_with_args(), and reused as the
return code from of_irq_parse_one(). This leads to an undetermined error
being returned instead of the expected -EINVAL value. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: stable@vger.kernel.org # 3.13+
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/of/irq.c