Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2974451imm; Fri, 20 Jul 2018 08:03:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcpsX9tafw4O0gUJrVm6+LUmgsdR+GIHJcJ+3AVgPzxilEH9zD4zlJ5qayLEzfQXiDvwwwo X-Received: by 2002:a62:2b4c:: with SMTP id r73-v6mr2580348pfr.134.1532098994593; Fri, 20 Jul 2018 08:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532098994; cv=none; d=google.com; s=arc-20160816; b=VJ+HmpX4wCllE9xnpqLJ/uN2Uq4aueegCxM77aKprrdXKQ63ZJGW7fA5Ep6gPq3AdC fctfFFpMqov3N3IVS3a1FrbcxTiFAOVjSBOsCTUtHZhb0onDa5WsC3xJgvZp+VYm92qZ iBJcmiVP1VQybFU4D3YHtoQeMVfSdzNQ9nPnpoIaQSMZ/J5V1dPA3ZlGCfFPCCCxcVDK l/RE+Z73oOK9weSZABxNffy9fqHtXweGUICcKZ6Ag+EwFSdqZwj58tBWT+KcDJW+4nBP 80oq09nyrnIbKYVcFVWwQ9kThKLCzWl6Ts/lkUhMwoWruIWXerWiNJUnVnru+6wO9hY1 ngFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=q5K889gEwbeG/ZtRFol2oLdNIfZMngW3bF2ZUs615GI=; b=q4u7chydIbLUq6yAqTq/XF8qgUmhkiZ/CnLjFHP1I6/ISFRzoTsbUKfw6MENLlwcXC z5sHLrctELmXNlSLBV7AkHa6A3csabmvm7La4yNdtqOYw4hZ+jwfaH8smceRe2XHoApo yfFrncQFy59xEEaePExlKHvmFQ1PxYU8VSelblgf99F1K34VPBxa1hIkz7uDb7GX/Yc6 3eG2igs6hSqATu9j1KaUeBrbOILMCUVi8ZRAXspMaGzbKXIKCSmP98po49bvI3c/gl0A aBnHtMbLnwXqC4+zR055xupqPpo4Me0LxIq9Ke24thWkaboDbmhAfKpb1VuafnX507Cb LjKA== ARC-Authentication-Results: i=1; mx.google.com; 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 e95-v6si1864136plb.239.2018.07.20.08.03.00; Fri, 20 Jul 2018 08:03:14 -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; 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 S1731900AbeGTPul (ORCPT + 99 others); Fri, 20 Jul 2018 11:50:41 -0400 Received: from gateway34.websitewelcome.com ([192.185.149.46]:21263 "EHLO gateway34.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731731AbeGTPul (ORCPT ); Fri, 20 Jul 2018 11:50:41 -0400 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 4D731127873 for ; Fri, 20 Jul 2018 10:02:00 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id gWuufmAfUBcCXgWuufR6Ui; Fri, 20 Jul 2018 10:02:00 -0500 X-Authority-Reason: nr=8 Received: from [189.250.65.56] (port=49402 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1fgWut-002zwH-KD; Fri, 20 Jul 2018 10:01:59 -0500 Date: Fri, 20 Jul 2018 10:01:58 -0500 From: "Gustavo A. R. Silva" To: Ryder Lee , Lorenzo Pieralisi , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] PCI: mediatek: Fix unchecked return value Message-ID: <20180720150158.GA10922@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.250.65.56 X-Source-L: No X-Exim-ID: 1fgWut-002zwH-KD X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.65.56]:49402 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 6 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check return value of devm_pci_remap_iospace. Notice that, currently, all instances of devm_pci_remap_iospace are being checked. Addresses-Coverity-ID: 1471965 ("Unchecked return value") Signed-off-by: Gustavo A. R. Silva --- drivers/pci/controller/pcie-mediatek.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c index 861dda6..1477939 100644 --- a/drivers/pci/controller/pcie-mediatek.c +++ b/drivers/pci/controller/pcie-mediatek.c @@ -1109,7 +1109,9 @@ static int mtk_pcie_request_resources(struct mtk_pcie *pcie) if (err < 0) return err; - devm_pci_remap_iospace(dev, &pcie->pio, pcie->io.start); + err = devm_pci_remap_iospace(dev, &pcie->pio, pcie->io.start); + if (err) + return err; return 0; } -- 2.7.4