From patchwork Fri Apr 28 08:55:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9704193 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0805B602B7 for ; Fri, 28 Apr 2017 08:56:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE5722846F for ; Fri, 28 Apr 2017 08:56:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1AFB28654; Fri, 28 Apr 2017 08:56:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 384882846F for ; Fri, 28 Apr 2017 08:56:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032941AbdD1I4B (ORCPT ); Fri, 28 Apr 2017 04:56:01 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35992 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425157AbdD1Izz (ORCPT ); Fri, 28 Apr 2017 04:55:55 -0400 Received: by mail-pg0-f67.google.com with SMTP id v1so4379409pgv.3 for ; Fri, 28 Apr 2017 01:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ywp2W3HA8XsVfPZM2ybJ6LV3eGb4BbYq1fjBuZie2KI=; b=g9Jdyoh645Q+xiHdeqJDMTh3O4YTJuLlXeRaz6uMD7tE1k9akkNKr/scLRuLYp0oTY llt7k4JOTgl6XKY5rAAqO2r5e+wf0Uy79gJ0VW3t6lOHa1STC+mRlpg5Fv+I1UkCDkxp 8DX1kuEHfLTxKHg8mZplC5jLD6JnyYXb/iMHZd8YaUHgVY/Zs9wHcmYO69fFkWk1VgjA a4DB5iQ+9viUk2p/Wz075pNKxJQ60UozZcEfVCzuYQCgH+2l6pcQk44jmK1rlxnL7z+o nyEmxglQZl11P8K2dqjWe5xJMnQc/Hcv0NtZ3FGVXypNOzyFa13srWAo2fCrcgQ0EG1x HgMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ywp2W3HA8XsVfPZM2ybJ6LV3eGb4BbYq1fjBuZie2KI=; b=FJuqjSL74PcmeZ9RynoVBazc0o1NZ8c9Usj0HnpuT+gUHpoko/7RtGKOysl0xEAcWb fha/NrGubG8T+XH0HbkiuzBc6N8dpfV3hOWvm9YX+u6LQPSeLWh7zci6SWo2Lr5ejWs9 ZLzalPIaQUYEuv4af5I1kEBBfbkNTTdyEsyNz8bazaTixgaqj3cIR/ZaKxPlrfYGfYII +eGz0pXZiS+JdpMidgDDYuMhDs4FboNLCubT/5lUvZxwZuzruCv8E4YCEMgC62Bg2II/ 8OcNZPoUDmgebN2S2Ql8LuJ+Znw0Q/2a8LLR8jhTJIqskE8bb5oTZYby7aXvVNO0RVgd t+fw== X-Gm-Message-State: AN3rC/7K/kUwhDfdlNYITgAvAikv0cgOKPln4BEiq2Bc4+BcSL54pxTt HTgPvoC+Aft2Fg== X-Received: by 10.98.147.26 with SMTP id b26mr10587780pfe.65.1493369754430; Fri, 28 Apr 2017 01:55:54 -0700 (PDT) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id p7sm8198656pfb.125.2017.04.28.01.55.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Apr 2017 01:55:53 -0700 (PDT) From: Wei Yongjun To: Kishon Vijay Abraham I , Bjorn Helgaas Cc: Wei Yongjun , linux-pci@vger.kernel.org Subject: [PATCH -next] PCI: endpoint: functions: Fix return value check in pci_epf_test_probe() Date: Fri, 28 Apr 2017 08:55:48 +0000 Message-Id: <20170428085548.15942-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Fix the return value check which testing the wrong variable in pci_epf_test_probe(). Fixes: 79ba640e377b ("PCI: endpoint: functions: Add an EP function to test PCI") Signed-off-by: Wei Yongjun --- drivers/pci/endpoint/functions/pci-epf-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index d6a7a12..53fff80 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -441,7 +441,7 @@ static int pci_epf_test_probe(struct pci_epf *epf) struct device *dev = &epf->dev; epf_test = devm_kzalloc(dev, sizeof(*epf_test), GFP_KERNEL); - if (!epf) + if (!epf_test) return -ENOMEM; epf->header = &test_header;