of/irq: Avoid calling list_first_entry() for empty list
authorAxel Lin <axel.lin@ingics.com>
Sun, 23 Jun 2013 07:50:07 +0000 (15:50 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 16 Feb 2015 02:31:34 +0000 (11:31 +0900)
commite6a5ea123c605b802d1862781ebc3d2c1798655d
treedaf971f9ca6fd48c703311f33cdcacd1f771a3fb
parentf1068f835e9931b1ccf378b088ae5668dd1d5190
of/irq: Avoid calling list_first_entry() for empty list

list_first_entry() expects the list is not empty, we need to check if list is
empty before calling list_first_entry(). Thus use list_first_entry_or_null()
instead of list_first_entry().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit c0cdfaa0a5e7a346ac2f661f63f543cdc5f7cbbe)
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/of/irq.c