pseries: Fix buggy spapr_vio_find_by_reg()
authorDavid Gibson <david@gibson.dropbear.id.au>
Sun, 13 Nov 2011 17:18:58 +0000 (17:18 +0000)
committerAlexander Graf <agraf@suse.de>
Fri, 18 Nov 2011 13:22:45 +0000 (14:22 +0100)
commit40c069c6df73807ef616ff9131e201289e877886
treea05e6df0b43eeefc37c73e36711ffe77f131568a
parentac9a22c14895c6e92ae01bdde032246f82ba0252
pseries: Fix buggy spapr_vio_find_by_reg()

The spapr_vio_find_by_reg() function in hw/spapr_vio.c is supposed to find
the device structure for a PAPR virtual IO device with the given reg value,
and return NULL if none exists.

It does the first ok, but if no device with that reg exists, it just
returns the last device traversed in the list.  This patch fixes it.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/spapr_vio.c