From patchwork Thu Jan 13 19:47:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 476651 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0DJmt85003392 for ; Thu, 13 Jan 2011 19:48:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756705Ab1AMTsB (ORCPT ); Thu, 13 Jan 2011 14:48:01 -0500 Received: from exchange.solarflare.com ([216.237.3.220]:51522 "EHLO exchange.solarflare.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755699Ab1AMTsA (ORCPT ); Thu, 13 Jan 2011 14:48:00 -0500 Received: from [10.17.20.137] ([10.17.20.137]) by exchange.solarflare.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 13 Jan 2011 11:47:59 -0800 Subject: [PATCH] PCI: sysfs: Fix failure path for addition of "vpd" attribute From: Ben Hutchings To: Jesse Barnes Cc: linux-pci , linux-net-drivers@solarflare.com, Yu Zhao Organization: Solarflare Communications Date: Thu, 13 Jan 2011 19:47:56 +0000 Message-ID: <1294948076.3946.51.camel@bwh-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 (2.32.1-1.fc14) X-OriginalArrivalTime: 13 Jan 2011 19:47:59.0781 (UTC) FILETIME=[C8392D50:01CBB35A] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.500.1024-17890.005 X-TM-AS-Result: No--9.311100-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 13 Jan 2011 19:48:55 +0000 (UTC) diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 63d5042..080028c 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -1087,7 +1087,7 @@ static int pci_create_capabilities_sysfs(struct pci_dev *dev) attr->write = write_vpd_attr; retval = sysfs_create_bin_file(&dev->dev.kobj, attr); if (retval) { - kfree(dev->vpd->attr); + kfree(attr); return retval; } dev->vpd->attr = attr;