iprutils: fix segmentation fault when qac is not available
iprutils: fix segmentation fault when qac is not available

For some operations iprutils needs to use the qac records to obtain information
about the ipr devices. However, under some circumstances the adapter sg device
may not be available yet and the qac retrieval will fail. A call to
__for_each_qac_entry macro will return a null pointer, which will cause the code
to segfault if the pointer is dereferenced. This patch fixes the problem by
expanding the for loop only if there are any qac record.

Signed-off-by: Kleber Sacilotto de Souza <3e92e3c568de7889d3f75db02645a8c2f2e396ca@linux.vnet.ibm.com>

leitao/iprutils