From patchwork Mon Jul 30 07:07:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 10548479 X-Patchwork-Delegate: eduardo.valentin@ti.com 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 3BFD514BC for ; Mon, 30 Jul 2018 06:59:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B345298D6 for ; Mon, 30 Jul 2018 06:59:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F127298DD; Mon, 30 Jul 2018 06:59:48 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 BE39E298D6 for ; Mon, 30 Jul 2018 06:59:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726480AbeG3IdJ (ORCPT ); Mon, 30 Jul 2018 04:33:09 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:10155 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726351AbeG3IdJ (ORCPT ); Mon, 30 Jul 2018 04:33:09 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9B6DABCA574B; Mon, 30 Jul 2018 14:59:22 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Mon, 30 Jul 2018 14:59:14 +0800 From: Wei Yongjun To: Zhang Rui , Eduardo Valentin , Miquel Raynal , Daniel Lezcano CC: Wei Yongjun , , Subject: [PATCH -next v3] thermal: armada: fix copy-paste error in armada_thermal_probe() Date: Mon, 30 Jul 2018 07:07:03 +0000 Message-ID: <1532934423-179537-1-git-send-email-weiyongjun1@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1532918717-46808-1-git-send-email-weiyongjun1@huawei.com> References: <1532918717-46808-1-git-send-email-weiyongjun1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The return value from devm_kzalloc() is not checked correctly. The test is done against a wrong variable. Fix it. Fixes: e72f03ef2543 ("thermal: armada: use the resource managed registration helper alternative") Signed-off-by: Wei Yongjun Reviewed-by: Daniel Lezcano Reviewed-by: Miquel Raynal --- v2 - > v3: fix the description --- drivers/thermal/armada_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index 8de4ba5..a269482 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -610,7 +610,7 @@ static int armada_thermal_probe(struct platform_device *pdev) return -ENOMEM; drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL); - if (!priv) + if (!drvdata) return -ENOMEM; priv->dev = &pdev->dev;