Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2944389imm; Sun, 16 Sep 2018 06:29:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZuvMCYd6cix7HjCJKIfzwKrUamzJ3ywta6vw94DDzk9CUrdQCWVEsW3rrZ68V9UvvqzWvZ X-Received: by 2002:a62:174a:: with SMTP id 71-v6mr21968561pfx.217.1537104580254; Sun, 16 Sep 2018 06:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537104580; cv=none; d=google.com; s=arc-20160816; b=daYGeqXBBOFpp7T9KcsUp+PiReCu9XFE/+tbMM04hHzMQT1W9WUcy3+1+sMmgNNFi5 znhJM45n6dyesMIQtOVLMi9R3w9Ui9StzKA85WXgKkYkqU1jV5Nzjsv127kjHwLgJh8b lh7akU4bHfjqeHyZE5iBPr1ZzvrADK+eNj3BqShCdgthfynouOoefi25U/X4Kn/KeCmH /4ER8gSJfmgfvkyI5/Nr7mTAj9nJh5sbhGZFS/vjkHLQ2Bo7djTSbh5gCu2C4fGyLYPv uiEAvcApI8NlqmWq9bg56NcpV8uhKxUlVaCHB4HXzWFW5K0D5+TDwrnIeumrvJ/fTJdR d7iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=HeWmtEIDv1RhyfHdhuifM8IX3SI/SeeqALM/LZDDUts=; b=FpzV+usePwGmZq6sqB9jgdKaeOFkox24p9DLOiBAIY5XcVdQZk96quhWz/Xx0LpCoP ZpssOVMc2yBtIqVdRzLAi8SJYkvazKt7CGlSc/MAtvtzXJDpJQjjd0sUmC20llFijyQb gByi5Qbo8uIb64mp2Q65u3Wk8lsh60wiQf5wli9WULEhsVPS7K/tgs3Sqxrt7WboM1wD evyoDFBGD9ovGAvo5MMJYXAfGKho1K2lYn1MLvQhp5o8vOlLrECKT1n8oMGy+hMqTA78 55bxPx9odqjvgjj9cg7Ln2Ydr2oaovbd9jZiOes3EGZTFE0sAvrS9E33rnME6p7h4QTJ ceGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12-v6si12979171pfd.142.2018.09.16.06.29.24; Sun, 16 Sep 2018 06:29:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728395AbeIPSwR (ORCPT + 99 others); Sun, 16 Sep 2018 14:52:17 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12156 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728350AbeIPSwR (ORCPT ); Sun, 16 Sep 2018 14:52:17 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 39CCBDCAD3B4E; Sun, 16 Sep 2018 21:29:13 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.399.0; Sun, 16 Sep 2018 21:29:09 +0800 From: zhong jiang To: CC: , , Subject: [PATCH] media: platform: remove redundant null pointer check before of_node_put Date: Sun, 16 Sep 2018 21:16:51 +0800 Message-ID: <1537103811-63670-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org of_node_put has taken the null pinter check into account. So it is safe to remove the duplicated check before of_node_put. Signed-off-by: zhong jiang --- drivers/media/platform/ti-vpe/cal.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c index cc052b2..5f9d4e0 100644 --- a/drivers/media/platform/ti-vpe/cal.c +++ b/drivers/media/platform/ti-vpe/cal.c @@ -1747,14 +1747,10 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst) } cleanup_exit: - if (remote_ep) - of_node_put(remote_ep); - if (sensor_node) - of_node_put(sensor_node); - if (ep_node) - of_node_put(ep_node); - if (port) - of_node_put(port); + of_node_put(remote_ep); + of_node_put(sensor_node); + of_node_put(ep_node); + of_node_put(port); return ret; } -- 1.7.12.4