From patchwork Sun Apr 17 15:22:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Thelen X-Patchwork-Id: 713511 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 p3HFLIV4007793 for ; Sun, 17 Apr 2011 15:22:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753832Ab1DQPWf (ORCPT ); Sun, 17 Apr 2011 11:22:35 -0400 Received: from smtp-out.google.com ([216.239.44.51]:5414 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752667Ab1DQPWe (ORCPT ); Sun, 17 Apr 2011 11:22:34 -0400 Received: from hpaq1.eem.corp.google.com (hpaq1.eem.corp.google.com [172.25.149.1]) by smtp-out.google.com with ESMTP id p3HFMXvB025259; Sun, 17 Apr 2011 08:22:34 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1303053754; bh=OO0bAkJgSNkGJHIjF1rO7z6s6Vk=; h=From:To:Cc:Subject:Date:Message-Id; b=eW3CkqdtkDx7AW87pJrIhz8LxaU8lTeR17IjvAbv8tAheg4K2PN890enC/FnfxRKJ +RNivN2c9wnklmUn0NDoA== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=from:to:cc:subject:date:message-id:x-mailer; b=uvSQtT/UHYSy8r2f7cYgVYU7XxGrwkTRd0j0izjqhA+KxhaaL+LxUDe0kG9exPcay Zv8V8lGrXOhQJ76rzjtVA== Received: from gthelen.mtv.corp.google.com (gthelen.mtv.corp.google.com [172.18.96.19]) by hpaq1.eem.corp.google.com with ESMTP id p3HFMPBb009366; Sun, 17 Apr 2011 08:22:25 -0700 Received: by gthelen.mtv.corp.google.com (Postfix, from userid 104648) id 07A8D1014BA; Sun, 17 Apr 2011 08:22:24 -0700 (PDT) From: Greg Thelen To: Jesse Barnes Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Thelen Subject: [PATCH] PCI: check pci_vpd_pci22_wait() return Date: Sun, 17 Apr 2011 08:22:21 -0700 Message-Id: <1303053741-384-1-git-send-email-gthelen@google.com> X-Mailer: git-send-email 1.7.3.1 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]); Sun, 17 Apr 2011 15:22:36 +0000 (UTC) pci_vpd_pci22_write() calls pci_vpd_pci22_wait() after writing PCI_VPD_DATA and PCI_VPD_ADDR to wait for the VPD operation to complete. The result pci_vpd_pci22_wait() was not checked for error. This change checks for error. Signed-off-by: Greg Thelen --- drivers/pci/access.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/pci/access.c b/drivers/pci/access.c index 502610b..fdaa42a 100644 --- a/drivers/pci/access.c +++ b/drivers/pci/access.c @@ -334,6 +334,8 @@ static ssize_t pci_vpd_pci22_write(struct pci_dev *dev, loff_t pos, size_t count vpd->busy = true; vpd->flag = 0; ret = pci_vpd_pci22_wait(dev); + if (ret < 0) + break; pos += sizeof(u32); }