Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp684474ybh; Sun, 12 Jul 2020 20:36:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCBy0AqoZy8CQ44KYYzJHm3ozX+GoRGrm5DrvAzLsNtGxuT7dphofynvoYLa3VmjbQhRBi X-Received: by 2002:a17:906:4086:: with SMTP id u6mr76553186ejj.9.1594611378967; Sun, 12 Jul 2020 20:36:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594611378; cv=none; d=google.com; s=arc-20160816; b=nduKeszMPuF08vgwq9yVdePJYj75WIx2DVn4u5BPp1OtC2/f9qAPihIM1NW/59Vo5Y Zq8fdHGyGNdABpK/WDQKNptbeoPIWqIQEqp1UKoHH+bv/1S8VKufzsNZVS4FlgCjDfFR KGkLg4kRczAwfDBFPL4SGJkN/Hesjqi6JSZ1FAf2lM4XGsc9hKVUfTJ+JX2EkdLfH5Kc Um/MAFdsbmzAf8uLNCPPtktpZYAuYYS1SubebC12/lrvgtdXYgAD7UPfzWYhPMUMYkxJ /87Y7NtMnuN1wsnvbEw9G+QYqX2edR1pZkamBruTmmNbe5StQ8Fdakiloot9w9GvGzA6 yBoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=L+POncNyal5K5+jJ689JhX6Y49H+WdgWJvuVX3qVoR8=; b=lxiuDRfBmDgfBjU1PCMZkBvf8H20cCDb/TF0g+iTmC4wh2SNfpxXtzYx6nYJMpTEOW inbTghKLHlP/JFQaE5ttZ/l5a01DGrwAhs+93BPNCeVwOHui/CXAhu/mjGHqSI8l+Qjy KnSPXu7D74/wKVx9aAnn0opQfAfLNFGOJM/yFerZ8cj9pNainR+dors+Z5knJjb6iYWo IXS47OgPnBQps1NllPKPS7/IGJPakWgUDh9AAcUtpjs4aGhTYCxEAlwp+uqHho3VX+yr Tp4ukoM3qxj8QV4SD464WdllXnArhryc+58oqEENiwRdDb+TCXXYo0YvVxnAVCqLJrmp tPGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si8805443edn.472.2020.07.12.20.35.56; Sun, 12 Jul 2020 20:36:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728511AbgGMDdc (ORCPT + 99 others); Sun, 12 Jul 2020 23:33:32 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21]:52530 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726523AbgGMDdb (ORCPT ); Sun, 12 Jul 2020 23:33:31 -0400 Received: from localhost (unknown [159.226.5.99]) by APP-01 (Coremail) with SMTP id qwCowADnhpj71Qtf7eZaAA--.61347S2; Mon, 13 Jul 2020 11:33:15 +0800 (CST) From: Xu Wang To: jk@ozlabs.org, joel@jms.id.au, alistair@popple.id.au, eajames@linux.ibm.com, linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Xu Wang Subject: [PATCH] fsi: fsi-occ: fix return value check in occ_probe() Date: Mon, 13 Jul 2020 03:33:13 +0000 Message-Id: <20200713033313.21487-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: qwCowADnhpj71Qtf7eZaAA--.61347S2 X-Coremail-Antispam: 1UD129KBjvdXoW7JFWfAF1kuF43Cw48CFy7trb_yoW3AFgEkw 4UurZ7XFs7GFnIq3s8t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ence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of error, the function platform_device_register_full() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Xu Wang --- drivers/fsi/fsi-occ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c index 7da9c81759ac..9eeb856c8905 100644 --- a/drivers/fsi/fsi-occ.c +++ b/drivers/fsi/fsi-occ.c @@ -555,7 +555,7 @@ static int occ_probe(struct platform_device *pdev) hwmon_dev_info.id = occ->idx; hwmon_dev = platform_device_register_full(&hwmon_dev_info); - if (!hwmon_dev) + if (IS_ERR(hwmon_dev)) dev_warn(dev, "failed to create hwmon device\n"); return 0; -- 2.17.1