Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3050902imm; Sun, 16 Sep 2018 08:44:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYMp3O7foDm4BbA8ZBCOvoeR27hULHrDQAq9Je4rniYiZglcO1VAI0FfCMxr4KZQhr9jXM+ X-Received: by 2002:a63:a441:: with SMTP id c1-v6mr20411856pgp.182.1537112648955; Sun, 16 Sep 2018 08:44:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537112648; cv=none; d=google.com; s=arc-20160816; b=PnCxugcLCEdgOkEPMMpzeEbylm0pvWfhUtoA0N/jA1FTcHQ451xBCSGpqaSbsAfpO1 Fclns7U8488Yqo8nqkU/2dobLI+n2I/Pwh2odSVjgterh8tZNBkFXEVqvKQvz4mOGt8q P7LKnk6kKVC9plQaulnCbIIbRCN98rFNmDkpncVeK+eVXdQVR6UKtHba4h6bNWufkuwc HNq03r/gCH5rIp02g+Vg+O+2AzdU2rC9npQA8/1ODOXMWn6794uJzAQhfi8H8t/0ZsQl BPr1HLrLvdKpScb9QUxuLFu5Td3gJAWpQJn8r6khlXsMc9Mx7BMW4AJHliQeJbLcA4Vx RFEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EtaApXq9VT6NNw2tMCAuqgstMuomjcw2ZxyEesfF/RE=; b=o2gLsuEKAitBkDC4Dkw8gVeBJ1MSAAsJLJpdYyRMntJjW/oY6HvmVTLLRmTq4MuRPM scsiM+XklZ1/FAv6Gcgl8LARJDPly3Ze7k9jrFylRa7qFCG5SazCmxYcfmcI88qlC9FS 3p7FtKLHBpOcNQOlmRxE5XS7c4jZq8QsxfMLMSkxQKx4YPuAK7zqmH9RRINEDd+IxpS+ 0KdG12VrtgyiEX8nvfXKnKrVHDPGZrjTjFLdqIS472qzt95RuFhkKhyK+doTus2k2kyS 0c5X8iLZXwwJeKQ6JJjJjcW52uBFwgVed1Lyc5wwG6VCSR11NHjL75DQv+xRd4+Q9FTc voww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=O27SQLkk; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10-v6si14074918pfk.162.2018.09.16.08.43.53; Sun, 16 Sep 2018 08:44:08 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=O27SQLkk; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728292AbeIPVHK (ORCPT + 99 others); Sun, 16 Sep 2018 17:07:10 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:35998 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbeIPVHJ (ORCPT ); Sun, 16 Sep 2018 17:07:09 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id w8GFhdBI117144; Sun, 16 Sep 2018 10:43:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1537112619; bh=EtaApXq9VT6NNw2tMCAuqgstMuomjcw2ZxyEesfF/RE=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=O27SQLkkrZHGIF6n89ncoacg/nIwKrSnaveFWNfHkWNzJ4ThreH7S0mRbqBvLIAaS z9zTiokN5YY2joehFDwqQWH9BAz7RpVHQA8+O8sXiZNwbljHVnXt47DQgCsUfKG1V/ 4qY67hDqgUYtYZvkCfYqAc9zeLcQfCggB+Nh2yY4= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8GFhdAY010816; Sun, 16 Sep 2018 10:43:39 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Sun, 16 Sep 2018 10:43:39 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Sun, 16 Sep 2018 10:43:38 -0500 Received: from ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with SMTP id w8GFhcYA009088; Sun, 16 Sep 2018 10:43:38 -0500 Date: Sun, 16 Sep 2018 10:43:38 -0500 From: Benoit Parrot To: zhong jiang CC: , , Subject: Re: [PATCH] media: platform: remove redundant null pointer check before of_node_put Message-ID: <20180916154338.GE17511@ti.com> References: <1537103811-63670-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1537103811-63670-1-git-send-email-zhongjiang@huawei.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Zhong, Thank you for the patch. zhong jiang wrote on Sun [2018-Sep-16 21:16:51 +0800]: > of_node_put has taken the null pinter check into account. So it is s/pinter/pointer/ > safe to remove the duplicated check before of_node_put. > > Signed-off-by: zhong jiang with the above change, 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; > } > -- > 1.7.12.4 >