not all interfaces will have a phandle (ie, it will be 0), so don't
let phandle 0 be used to find any of these.
discussed with miod@
-/* $OpenBSD: ofw_misc.c,v 1.39 2023/04/03 01:30:32 dlg Exp $ */
+/* $OpenBSD: ofw_misc.c,v 1.40 2023/04/03 01:34:06 dlg Exp $ */
/*
* Copyright (c) 2017-2021 Mark Kettenis
*
{
struct if_device *ifd;
+ if (phandle == 0)
+ return (NULL);
+
LIST_FOREACH(ifd, &if_devices, if_list) {
if (ifd->if_phandle == phandle)
return (ifd->if_ifp);