From patchwork Sun Sep 16 13:16:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhong jiang X-Patchwork-Id: 10601701 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 955FB13AD for ; Sun, 16 Sep 2018 13:29:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84D3E29622 for ; Sun, 16 Sep 2018 13:29:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7897D29663; Sun, 16 Sep 2018 13:29:26 +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 0F78829622 for ; Sun, 16 Sep 2018 13:29:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728354AbeIPSwR (ORCPT ); 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 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Benoit Parrot --- 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; }