• G
    spapr: fix xics_system_init() error path · 844afc54
    Greg Kurz 提交于
    Commit 3d85885a tried to fix error handling, but it actually
    went into the wrong direction by dropping the local Error *.
    
    In the default KVM case, the rationale is to try the in-kernel XICS first,
    and if not possible, to fallback to userland XICS. Passing errp everywhere
    makes this fallback impossible if errp is &error_fatal (which happens to
    be the case). And anyway, if the caller would pass a regular &local_err,
    things would be worse: we could possibly pass an already set *errp to
    error_setg() and crash, or return an error even in case of success.
    
    So we definitely need a local Error * and only propagate it when we're
    done with the fallback logic. This is what this patch does.
    Signed-off-by: NGreg Kurz <groug@kaod.org>
    Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
    844afc54
spapr.c 142.3 KB