HomeFreeBSD

loader: net_open() should not replace f->f_devdata

Description

loader: net_open() should not replace f->f_devdata

net_open() does replace f_devdata with pointer to netdev_sock,
this will cause memory leak when device is closed, but also does
alter the devopen() logic.

We should store &netdev_sock to dev->d_opendata instead, this
would preserve and follow the devopen() logic.

Fixes network boot on aarch64 (tested by bz).

Reviewed-by: imp
MFC After: 2 weeks
Differential Revision: https://reviews.freebsd.org/D32227

(cherry picked from commit 98e805b4a18d6ef4d3c9924166e1217e0430290d)

Details

Provenance
tsoomeAuthored on Sep 24 2021, 3:04 PM
impCommitted on Jan 24 2023, 9:49 PM
Differential Revision
D32227: loader: net_open() should not replace f->f_devdata
Parents
rGf67328181236: loader.efi: remove extra extern ST
Branches
Unknown
Tags
Unknown