diff --git a/net/ethtool/phy.c b/net/ethtool/phy.c index 560dd039c6625ac0925a0f28c14ce77cf768b6a5..7662de03b9e180b2f87c2ea406c41093d6476183 100644 --- a/net/ethtool/phy.c +++ b/net/ethtool/phy.c @@ -234,8 +234,10 @@ int ethnl_phy_done(struct netlink_callback *cb) { struct ethnl_phy_dump_ctx *ctx = (void *)cb->ctx; - if (ctx->phy_req_info->base.dev) + if (ctx->phy_req_info->base.dev) { ethnl_parse_header_dev_put(&ctx->phy_req_info->base); + ctx->phy_req_info->base.dev = NULL; + } kfree(ctx->phy_req_info);