From patchwork Mon Nov 26 08:11:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10697757 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 93E5215A7 for ; Mon, 26 Nov 2018 08:12:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8544129721 for ; Mon, 26 Nov 2018 08:12:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79079297D6; Mon, 26 Nov 2018 08:12:22 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2877D297CB for ; Mon, 26 Nov 2018 08:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=lulgFXH6JJGEI5yXHEitVLT+kiS5b8tcxUlyrHkJ4w8=; b=fpr9EnV0mCJCXI OnRN2tXOL30q+NZxdq+mdMoHAM3Mk2LsQmq57OsAghLtTq4mhlvmHfkLg3dL0Y0Vwqlj3gharKuWH tceJdAnP4x5/WkXFf5gq6U0YrsWXRgqxnkxdCKeq+wkGKkmsxfbb7ovcWJWpxQcfjjy+etAKvDACm sF1IIe6uddwQG65hwzd5QoNcC/8H0wcgiwBZbamSghPZHAgoRHzR8STeaJwfQE9VYlZku1zjSPrJv 0wZTwSC60bjRSsrB1WUgIbW5Ni4UxpxAJEwnMOJqg8qVyudkJx+Uhdct0g5ZZ9eNUz5tooBb9dRxv SOQjMf1c1xs/q1CzwuCw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRC0A-0008M4-Ch; Mon, 26 Nov 2018 08:12:18 +0000 Received: from userp2120.oracle.com ([156.151.31.85]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRC07-0008LI-LP for ath10k@lists.infradead.org; Mon, 26 Nov 2018 08:12:17 +0000 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAQ83kku065235; Mon, 26 Nov 2018 08:12:02 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=e6D4lfK2FmHZ0WU2nj9+12Qi2FPCbpsHsKfuZE0P7gk=; b=qX3/n0zvhKxZtFMhrcspc0tBoJlJFecjf7n/8ZYgcFeGQBdVaWHjzgX2t9wxkuxt/WwZ gIlLwacHtPaDeq+nfUL8kg+Epb7OlDv9pEwCg4YEPC7haQlGKUC5KrRXq0PeNDltPA9f aiWEDI7wqB9uIKbRUg2YXwk9xZ3oSP9ilwTvvc/KROXN9Jm74oFuVDRlQQta3338NyJ2 Ff57TZ5igXlHvL0o5df2qqYwqXuecqsCGTe+57YFtL9JGpoTtACKh9Fjuk3VPi1Vt7xt NJwMfxBFjfcfS8Q9QYhbntAVmiHFyYaMQbeqNtfcKLx+OSiO7Qkqfb7RGaNjX2ScX/33 Mw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2nxy9qv3cs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Nov 2018 08:12:02 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wAQ8C1TJ016932 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Nov 2018 08:12:01 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wAQ8C1f7021397; Mon, 26 Nov 2018 08:12:01 GMT Received: from kili.mountain (/41.202.241.51) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 26 Nov 2018 00:12:00 -0800 Date: Mon, 26 Nov 2018 11:11:43 +0300 From: Dan Carpenter To: Kalle Valo , Govind Singh Subject: [PATCH] ath10k: fix a NULL vs IS_ERR() check Message-ID: <20181126081143.tvu55aimdc3safcq@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=9088 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=909 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811260076 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181126_001215_782810_5E11DCA3 X-CRM114-Status: GOOD ( 17.28 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The devm_memremap() function doesn't return NULLs, it returns error pointers. Fixes: ba94c753ccb4 ("ath10k: add QMI message handshake for wcn3990 client") Signed-off-by: Dan Carpenter --- drivers/net/wireless/ath/ath10k/qmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c index f0429bee35c2..37b3bd629f48 100644 --- a/drivers/net/wireless/ath/ath10k/qmi.c +++ b/drivers/net/wireless/ath/ath10k/qmi.c @@ -931,9 +931,9 @@ static int ath10k_qmi_setup_msa_resources(struct ath10k_qmi *qmi, u32 msa_size) qmi->msa_mem_size = resource_size(&r); qmi->msa_va = devm_memremap(dev, qmi->msa_pa, qmi->msa_mem_size, MEMREMAP_WT); - if (!qmi->msa_va) { + if (IS_ERR(qmi->msa_va)) { dev_err(dev, "failed to map memory region: %pa\n", &r.start); - return -EBUSY; + return PTR_ERR(qmi->msa_va); } } else { qmi->msa_va = dmam_alloc_coherent(dev, msa_size,