Hitting the fail path with err = 0 causes callers to dereference a NULL
pointer, as 0 fails an IS_ERR() check.
All of the paths appear to be fine, but leave some logic to help catch stray
misuses.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
return d;
fail:
+ ASSERT(err < 0); /* Sanity check paths leading here. */
+ err = err ?: -EILSEQ; /* Release build safety. */
+
d->is_dying = DOMDYING_dead;
if ( hardware_domain == d )
hardware_domain = old_hwdom;