From patchwork Thu Aug 2 08:29:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10553357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2DDB613B4 for ; Thu, 2 Aug 2018 08:29:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D9832B842 for ; Thu, 2 Aug 2018 08:29:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 116E02B84E; Thu, 2 Aug 2018 08:29:45 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,UNPARSEABLE_RELAY 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 052312B842 for ; Thu, 2 Aug 2018 08:29:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731845AbeHBKTr (ORCPT ); Thu, 2 Aug 2018 06:19:47 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:37170 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729735AbeHBKTr (ORCPT ); Thu, 2 Aug 2018 06:19:47 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w728T6aJ031699; Thu, 2 Aug 2018 08:29:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=bzOiIcZhG4B1az22DJKp8cOeVst4s+tSu/HId5CLkJo=; b=KN4Alpgb5AQ0ZTvMenvbl845WIqRK9hA8D6jOBTLnCgvt+niqy1AhAEDq9eYbiq6IC/V 5nPJyA+PFrVxped183Ac91VewfqM2oYkkThb2cOqUyhVV+GHt4thOSdWrw5AfP/KHj+/ Ngh8kFw4y1cDCwfvzzE3AQwtjP/kuqrPs21ln02L4JK5pUB3eMlMZYkEKNyFiSNgmg3V mYRnwFi6dXPrU22MBp/FRZ7Unfc/k8ZMRuuOgPOsHwodfLJkKTsxYWxYHcM80QHIsOdR Z5xEo7DmZ26ftx7my5H+gAdDmkKiEq32PniD37HJhJEk2BKmnhT7jmbzj6c82LVDcL8M Kg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2kggepa4h7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 02 Aug 2018 08:29:39 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w728TdnJ029060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 2 Aug 2018 08:29:39 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w728Tcct023089; Thu, 2 Aug 2018 08:29:38 GMT Received: from kili.mountain (/197.232.248.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 02 Aug 2018 01:29:38 -0700 Date: Thu, 2 Aug 2018 11:29:31 +0300 From: Dan Carpenter To: Wu Hao , Kang Luwei Cc: Alan Tull , Moritz Fischer , linux-fpga@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] fpga: dfl: fme: error pointer vs NULL bug Message-ID: <20180802082931.6nfcgaztkxbkrgh7@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8972 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1808020091 Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The dfl_fme_create_region() function doesn't return NULL pointers, it returns error pointers. Fixes: 29de76240e86 ("fpga: dfl: fme: add partial reconfiguration sub feature support") Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-fpga" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/fpga/dfl-fme-pr.c b/drivers/fpga/dfl-fme-pr.c index fc9fd2d0482f..0b840531ef33 100644 --- a/drivers/fpga/dfl-fme-pr.c +++ b/drivers/fpga/dfl-fme-pr.c @@ -420,7 +420,7 @@ static int pr_mgmt_init(struct platform_device *pdev, /* Create region for each port */ fme_region = dfl_fme_create_region(pdata, mgr, fme_br->br, i); - if (!fme_region) { + if (IS_ERR(fme_region)) { ret = PTR_ERR(fme_region); goto destroy_region; }