iprutils: fix possible problems with yl_serial_num filling
iprutils: fix possible problems with yl_serial_num filling

In function check_current_config(), when inquiring the IOA to fill the
yl_serial_num structure field, the di_vpd struct is used even if the
call to ipr_inquiry() has failed, which can lead to segmentation fault
since the struct can have any values in it. Other issues can also happen
since pchr is used without checking if strstr() successfully found the
substring.

This patch fixed the problem by checking for the return code from
ipr_inquiry() and the pointer returned by strstr().

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

leitao/iprutils