Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp844726ybi; Fri, 12 Jul 2019 05:35:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBsdjIWYQ/yv14tIcgm4s5Df2SvT9w2r4u7dE23WiRL8FIxu6lLkIEZJr+YxpkO1Ufjder X-Received: by 2002:a63:194f:: with SMTP id 15mr10780812pgz.382.1562934944072; Fri, 12 Jul 2019 05:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934944; cv=none; d=google.com; s=arc-20160816; b=AF5JHXIM9LMMuyaZb8/1vHPxUQFadXlTfrWABiXFprmCgXPyJSzGdKqLVTvxvnAyZi /uBwN3OGdzW/eMec0WbMAyNRdBv2LWJ2s7+EzJLUoajyAAN1FjXYNATtcgzIaqph7lJA UpJLZiul/2u0zvudRzRHy8aBGieaAikkdLGIkhOa9AsYIb8N+LjfjUcbpdX+vc0iKSCM JKAJi+Fsuje+tNUZkDDjIlgSp4wka4RulSGYPqA6VZz0gqOOAG5Fz1HkEGMfekYaxCGi WlBTsJH0FXjSmwqx8pakCFPORIW92nrdc1ELq4U7OHQ0T9hkAA7MU560BdFpy9o+aKvK 4pRA== 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=b+5hc2VGqdjg+dwc6QkeK7wBsrB1LecMK1O0qdGWUB69F9K7tT3vNmiKJh1SN4sWNz eWOcxNpRwLisrHs+LyVrxaBb3RCIjZRxFcifXAYR7LGxo7x9DmSinkSXIQYY3pfRhURX oZoIMub+qdOneRvyBUh70DPh5pfw/Dn2qZw8FXZALaTxR2gQ7F6STc+blcZo7nLmvWYz fweYYc7GAQ9oNmRsAswjee2zhCCJ3j0NaLPdWvxpyuA+BjnPQ5121O3av8jABZu1g3FT BjTKgMOm2yBHCvyHvBU6tM0EFTAzxyPBzIMV+oswJxmgHWHpmi4RQRx6v+SMOQK0uZo0 fcTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="oJ//bFaD"; 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 q8si8150572pfc.155.2019.07.12.05.35.28; Fri, 12 Jul 2019 05:35:44 -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="oJ//bFaD"; 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 S1728851AbfGLMe0 (ORCPT + 99 others); Fri, 12 Jul 2019 08:34:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:54222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729326AbfGLMeY (ORCPT ); Fri, 12 Jul 2019 08:34:24 -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 385A120645; Fri, 12 Jul 2019 12:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934863; bh=vUf3XpGa+WekQ5lIiG92xQn8VR8/MuKJgGBSwBLnhYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oJ//bFaD6OKUYkxdmOx25xCnm7OY6R0Rd0HXzkgDjegutAvefnFK/xfjxgR34oqXs 84jTmlmlpqDv8QTtGktwxUsTwPyvSB/9JolkKaf/akDDgWNGywmx/L+5cxa9K/tlCT +/CyeTeBh+jKyf3fYo+guPmCO4O+fEqPtLXmi4js= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King Subject: [PATCH 5.2 56/61] staging: fsl-dpaa2/ethsw: fix memory leak of switchdev_work Date: Fri, 12 Jul 2019 14:20:09 +0200 Message-Id: <20190712121623.783638764@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121620.632595223@linuxfoundation.org> References: <20190712121620.632595223@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; }