OSDN Git Service

efidp_is_multiinstance(): check for efidp_next_node() == 0 in our iter
authorPeter Jones <pjones@redhat.com>
Wed, 19 Oct 2016 18:18:27 +0000 (14:18 -0400)
committerPeter Jones <pmjones@gmail.com>
Wed, 19 Oct 2016 19:06:12 +0000 (15:06 -0400)
commit2e013d069a3f349c2dd492e1176bf75d7310979b
tree8271a10fcbc8ce118432d193cca9717e3d475879
parenta30a8d4447cfc252ed045e43934dbe237dc57eb9
efidp_is_multiinstance(): check for efidp_next_node() == 0 in our iter

GCC doesn't seem to want to believe that the NULL and length tests in
in efidp_is_multiinstance()->efidp_next_node()->efidp_node_size()
actually catches things, Possibly because it wouldn't be acted on until
the next iteration through the loop.   So check that case explicitly in
efidp_is_multiinstance().  Also forcibly set 'next' to NULL, to ensure
efidp_next_node() will catch it.

Signed-off-by: Peter Jones <pjones@redhat.com>
src/include/efivar/efivar-dp.h