Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp851374ybi; Fri, 12 Jul 2019 05:42:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqybydavRM8cGwl5xwKIgzHRoRwuNbFO4ZmUt90LM8Hn2HiQPvgatXZJG6dTTsZ7tJay7jO/ X-Received: by 2002:a17:90a:7d09:: with SMTP id g9mr11350859pjl.38.1562935353485; Fri, 12 Jul 2019 05:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562935353; cv=none; d=google.com; s=arc-20160816; b=FW5p4tfxNqp7j7vT8qW9sg0Wm2BnexDYPuns74uOrrjn80sqrVtEINFosnlrT1hzkP gxmDhB4maYIi3igUoOzOOvEcHPRJ3e5oxO6GLk7NGnsw8kR/wjk3PuxXZP3AMwAEPMGi 5DIlwh6ekg5kOLbhAph3M3C1JQEzevoMZDyevd/lphGMzvf65/j5yojCaRvn4IARBU2E kQL2qXKcyxWKtAlGLrhBrfzawX3XZPbntoKcSYk0Ab4cU5m16juV/qs/FHNokd6hMGYs czFw6HjqDYTGwMFVGeoy08UcE9uZrzgVfCAQkDWnmRJWplsoSUyjISkEobjPQ2412QEJ fEqQ== 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=VOr1uwnboJsN2e6Ff2BMWwk0iMdmh3Y0H65pgBQWovc=; b=QHLJSCs+k4B5NLPNtc7qfIJaRZXMklhaUI5EF4txVkq+odLEH1atRWNia1x1z5H3hN OdWgzZxsfOughWPH2dalHt4GTVPNJmpfUQv/JfOEri9zvfPpwjYdN7+4Fng6p8lhSfbj g+bHH8Kb8shDm7ArVayqpspFfmONGaeUFP0jWOna9FTMe2XwFq6CvKzYByfG8Q1mVgwS zqR8eDsBUSm5mcwVKxrFYe2e0CfI6s3HgCtGAbwTrZ+/EDd+TqoFWNlbe2QLwKHUkQBm SaUSIuf/KwIyACbPLQExWfZDNBM3SFp5fYJ0yzmz+fj/9ZQuWJIpmUfS0MgrjsIe5J9+ NLPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zVruzWb3; 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 f89si8310821pje.50.2019.07.12.05.42.17; Fri, 12 Jul 2019 05:42:33 -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=zVruzWb3; 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 S1728105AbfGLMYY (ORCPT + 99 others); Fri, 12 Jul 2019 08:24:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:60976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728078AbfGLMYT (ORCPT ); Fri, 12 Jul 2019 08:24:19 -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 3C4332084B; Fri, 12 Jul 2019 12:24:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934258; bh=UoV8L7qo+XMutDisrOqQ2Nl63vl8UkSaqOPSlJTubfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zVruzWb3RxfxK1fajB/1wrxsVX1hsskuWpd0yNWrUs0egQjavgth6UD84vgygjHog Dw+sEXEBqSk0HDQXwrcw9yRAoNTNEgbIt/4bHTdFKEPrWDRSwXwldXVbHBJTyr3tDp JnFggrObp7SFCgO+8uBXC8Io5DxaPCk8NRN99usA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King Subject: [PATCH 4.19 86/91] staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work Date: Fri, 12 Jul 2019 14:19:29 +0200 Message-Id: <20190712121626.341957714@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121621.422224300@linuxfoundation.org> References: <20190712121621.422224300@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 @@ -1073,6 +1073,7 @@ static int port_switchdev_event(struct n dev_hold(dev); break; default: + kfree(switchdev_work); return NOTIFY_DONE; }