Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2996204pxx; Sun, 1 Nov 2020 18:34:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxCJphwfjwg5bizvgpGa4APhfj8vL959mEOCuxZjfPP5BnYaDUI3uyH+4ypNqAL4PMEcNQ1 X-Received: by 2002:a17:907:119e:: with SMTP id uz30mr12714825ejb.125.1604284444763; Sun, 01 Nov 2020 18:34:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604284444; cv=none; d=google.com; s=arc-20160816; b=oTgrC7JCPhbergkBHy1iHn0HIarOmixFAmV+97IKPD/IknszykuEDbe57tehQLt7iS S7PQsfjZ8Gav9Q5fczLosB174guooRgXfJH20LgykFRnMH6YeyPSnWaoqEF2S2A4Il7x T6mKV9IVoblsG37t3x6wumiLtJbi3rGFRNcbZhQ/4qMo7cZPPFpIEoLE8gt9FUlt2PGy NmEhNLGAOfcw+QeqC6AMjI1STeZb5SHRhc5d4RJDGQyy3Zh0PxwIQsfSY86g+IDw+Bqj 675tCvavZvM8UJFUBuTCnt7ubB+tXnW91qAGdJscppEK6Ob134On87qH/km2Z+JvRHsC 2E4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5++yMp7HjqoVMSX99r3hwuQ4LRtZ6smzeXRur40rbEU=; b=wSUwpnxJ6RkzXN5sPj3Gv4TnBq1Lvp4ubmLsz3vf3Z9iu8P1pOYMeF5FeVAnVN7Z+a YpjDRGmHl5AizS7cq7MlrtEzdaK26/qSkzpCPOKvmjI+/arAyf9xW1cFbL1zu6xsTfGQ 5I70gXWUakMf88Xkjp7vRrrobGew/pa/BXD4F5xrxbHVKkF7fJneahSWPjarKKHsXiNQ sppLGXYFBb9EjxKlt7cTHEVx33InrP3/qeKrkiHH5YvHuPLSFGsR8R9iiGAplu7GIXM2 2hpF+QYnjZQy2trt9GZE3NbVP1/dQKzgsYB9NniCPB71t6go6vghJ2uvONT8/gn35GpT vyQA== 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 ga34si9565012ejc.296.2020.11.01.18.33.41; Sun, 01 Nov 2020 18:34:04 -0800 (PST) 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 S1727498AbgKBCba (ORCPT + 99 others); Sun, 1 Nov 2020 21:31:30 -0500 Received: from mail-m17613.qiye.163.com ([59.111.176.13]:29471 "EHLO mail-m17613.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727409AbgKBCb3 (ORCPT ); Sun, 1 Nov 2020 21:31:29 -0500 Received: from ubuntu.localdomain (unknown [58.213.83.156]) by mail-m17613.qiye.163.com (Hmail) with ESMTPA id 762C8482A58; Mon, 2 Nov 2020 10:31:27 +0800 (CST) From: Bernard Zhao To: Zhang Rui , Daniel Lezcano , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Bernard Zhao Subject: [PATCH] drivers/thermal: cleanup coding style a bit Date: Sun, 1 Nov 2020 18:31:21 -0800 Message-Id: <20201102023121.3312-1-bernard@vivo.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZSB1ISE8eTUJLQxlNVkpNS09JQ09JQ0xNSU1VEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKQ1VLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6PDo6EAw5Kz8aGSFDLDJINjc0 TU1PCTBVSlVKTUtPSUNPSUNDS0JCVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlOQ1VJ SkhVQ0hVSk5NWVdZCAFZQUpNQ043Bg++ X-HM-Tid: 0a7586cb8a5b93bakuws762c8482a58 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function thermal_add_hwmon_sysfs, hwmon will be NULL when new_hwmon_device = 0, so there is no need to check, kfree will handle NULL point. Signed-off-by: Bernard Zhao --- drivers/thermal/thermal_hwmon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c index 8b92e00ff236..ad03262cca56 100644 --- a/drivers/thermal/thermal_hwmon.c +++ b/drivers/thermal/thermal_hwmon.c @@ -206,8 +206,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) if (new_hwmon_device) hwmon_device_unregister(hwmon->device); free_mem: - if (new_hwmon_device) - kfree(hwmon); + kfree(hwmon); return result; } -- 2.29.0