From: Vadim Fedorenko Date: Tue, 26 Jan 2021 00:02:14 +0000 (+0300) Subject: net: decnet: fix netdev refcount leaking on error path X-Git-Tag: accepted/tizen/unified/20230118.172025~7993^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f96d644976825986a93b7b9fe6a9900a80f2e11;p=platform%2Fkernel%2Flinux-rpi.git net: decnet: fix netdev refcount leaking on error path On building the route there is an assumption that the destination could be local. In this case loopback_dev is used to get the address. If the address is still cannot be retrieved dn_route_output_slow returns EADDRNOTAVAIL with loopback_dev reference taken. Cannot find hash for the fixes tag because this code was introduced long time ago. I don't think that this bug has ever fired but the patch is done just to have a consistent code base. Signed-off-by: Vadim Fedorenko Link: https://lore.kernel.org/r/1611619334-20955-1-git-send-email-vfedorenko@novek.ru Signed-off-by: Jakub Kicinski --- diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 4cac31d..2193ae5 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c @@ -1035,7 +1035,7 @@ source_ok: fld.saddr = dnet_select_source(dev_out, 0, RT_SCOPE_HOST); if (!fld.daddr) - goto out; + goto done; } fld.flowidn_oif = LOOPBACK_IFINDEX; res.type = RTN_LOCAL;