From patchwork Thu Jan 23 20:01:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 3531371 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DAC6BC02DC for ; Thu, 23 Jan 2014 20:00:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0683F20181 for ; Thu, 23 Jan 2014 20:00:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D9C6B2016C for ; Thu, 23 Jan 2014 20:00:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752444AbaAWUAY (ORCPT ); Thu, 23 Jan 2014 15:00:24 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35605 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752203AbaAWUAX (ORCPT ); Thu, 23 Jan 2014 15:00:23 -0500 Received: from localhost (c-76-28-255-20.hsd1.wa.comcast.net [76.28.255.20]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C558A26; Thu, 23 Jan 2014 20:00:22 +0000 (UTC) Date: Thu, 23 Jan 2014 12:01:12 -0800 From: Greg Kroah-Hartman To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Dave Jones Subject: [PATCH] PCI: msi: properly free memory on an error path Message-ID: <20140123200112.GA15503@kroah.com> References: <20140123184246.GA7461@google.com> <20140123193037.GA2605@kroah.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140123193037.GA2605@kroah.com> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Greg Kroah-Hartman Coverity reported that I forgot to clean up some allocated memory on the error path in populate_msi_sysfs(), so this patch fixes that. Thanks to Dave Jones for pointing out where the error was, I obviously can't read code this morning... Fixes: 1c51b50c2995 ("PCI/MSI: Export MSI mode using attributes, not kobjects") Cc: Dave Jones Signed-off-by: Greg Kroah-Hartman --- drivers/pci/msi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 39dff3fe57af..6f0474ebe420 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -595,6 +595,7 @@ error_attrs: ++count; msi_attr = msi_attrs[count]; } + kfree(msi_attrs); return ret; }