Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp848742ybi; Fri, 12 Jul 2019 05:39:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaRYNs0o6HXstRga6dZVQAhwf5fm7iHvJby85TRR1VbxHOQdUiAiPz6rIC9o/Ms+leMdw0 X-Received: by 2002:a17:902:82c4:: with SMTP id u4mr11288584plz.196.1562935196549; Fri, 12 Jul 2019 05:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562935196; cv=none; d=google.com; s=arc-20160816; b=01D79iED8Q7/GYoDZEWh4arUCNQ7KkhnG9kfp6JPLypJQrw/2mAhkEphIusxA4okbO zVahxfvXc3L4S8YlzjsO6yiAqgfQB9I+6r2cc6XfJqg6vtCzdzIcWKZ19mCj/k4703j4 Zdy+VsFCeQmjv7MK+nPFjHORvmTZEHAUGgRTghZxKa6fbjgVS8jQvffGfCUaaYV91fbn q6CLpwZwH2/c+fJaIYpQ6srJhiWV6dxkwIB72RnzA3Xo/hnCnyeKHIujFlYocMhC/JIB nEdtGTuzbMwBvSZC1GlKQ7AJNLgK4Ps0WzfFOy+qKJo97mrT3OQV0F/mIgK+6uhnrB7E n0kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r4kppoONxoaIiQmpzoEQGT0rVkoQG4BTyEkN1OgQZpI=; b=Z4OImA5G89MH2EAqHVY2aIkMD39BPUdXwu2jcZNN5WwQOpHrl9uGNV3xfhezQinA7H n9WyyjPqNOZdkcIrI6VsEziK6J/YBQMjPxkVWcT5wrUfcoWRkwXqT7hIRPbxCvCfUp/D WrHA28df1fM4tc3Gdi4kQszxkD3psjpFW1ph+omav+jNHW1Y9OVlyK247UBOAU0e1jRJ vqpCmacn0V2s7DrpkQj+49A68zKlfRccWVWx2KmVn5C07a5Sm+Tggw+yN++hZC0WqqMA IM6HWsGEU+XbkTU0ffGDxlkz6twlaWYInzYh7ljL12twToDOjMhqepWx7ImKBQoCRZGw FiyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K5gwlWIs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v99si7869679pjb.82.2019.07.12.05.39.41; Fri, 12 Jul 2019 05:39:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K5gwlWIs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729106AbfGLMbQ (ORCPT + 99 others); Fri, 12 Jul 2019 08:31:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:47738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729328AbfGLMbO (ORCPT ); Fri, 12 Jul 2019 08:31:14 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A26992166E; Fri, 12 Jul 2019 12:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934674; bh=vUf3XpGa+WekQ5lIiG92xQn8VR8/MuKJgGBSwBLnhYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K5gwlWIs9VTLRDvjjX/OPSEXVRM3tWhQkHy908Q8lWK48QaWgHkKImCGcmFKJyiTD mgrzun9f1OXuxVu3ihmKd7bxYrBXgszgkahFvFRLlcgJWUjvTGlI+JLC3E5qba5UfX 3gauOz+2XVbZH7+4s991yOsWyzvOxnFDaMp0tFc0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King Subject: [PATCH 5.1 133/138] staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work Date: Fri, 12 Jul 2019 14:19:57 +0200 Message-Id: <20190712121633.820876009@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King commit 5555ebbbac822b4fa28db2be15aaf98b3c21af26 upstream. In the default event case switchdev_work is being leaked because nothing is queued for work. Fix this by kfree'ing switchdev_work before returning NOTIFY_DONE. Addresses-Coverity: ("Resource leak") Fixes: 44baaa43d7cc ("staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver") Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman --- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c @@ -1086,6 +1086,7 @@ static int port_switchdev_event(struct n dev_hold(dev); break; default: + kfree(switchdev_work); return NOTIFY_DONE; }