From patchwork Sun Nov 12 08:18:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 10054663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 02D1B60365 for ; Sun, 12 Nov 2017 08:19:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E07232997E for ; Sun, 12 Nov 2017 08:19:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2C202998E; Sun, 12 Nov 2017 08:19:09 +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=-6.9 required=2.0 tests=BAYES_00,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 3E1402997E for ; Sun, 12 Nov 2017 08:19:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751797AbdKLITC (ORCPT ); Sun, 12 Nov 2017 03:19:02 -0500 Received: from gateway34.websitewelcome.com ([192.185.148.204]:16110 "EHLO gateway34.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751573AbdKLITB (ORCPT ); Sun, 12 Nov 2017 03:19:01 -0500 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway34.websitewelcome.com (Postfix) with ESMTP id EE93228C9CE for ; Sun, 12 Nov 2017 02:19:00 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id DnToesA75RtUXDnToe2P99; Sun, 12 Nov 2017 02:19:00 -0600 Received: from [189.175.248.21] (port=58626 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1eDnTo-002q1g-E3; Sun, 12 Nov 2017 02:19:00 -0600 Date: Sun, 12 Nov 2017 02:18:59 -0600 From: "Gustavo A. R. Silva" To: Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] usb: uvc_debugfs: remove unnecessary NULL check before debugfs_remove_recursive Message-ID: <20171112081859.GA19079@embeddedor.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.175.248.21 X-Source-L: No X-Exim-ID: 1eDnTo-002q1g-E3 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.175.248.21]:58626 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 3 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes 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 NULL check before freeing functions like debugfs_remove_recursive is not needed. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Laurent Pinchart --- drivers/media/usb/uvc/uvc_debugfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_debugfs.c b/drivers/media/usb/uvc/uvc_debugfs.c index 368f8f8..6995aeb 100644 --- a/drivers/media/usb/uvc/uvc_debugfs.c +++ b/drivers/media/usb/uvc/uvc_debugfs.c @@ -128,6 +128,5 @@ void uvc_debugfs_init(void) void uvc_debugfs_cleanup(void) { - if (uvc_debugfs_root_dir != NULL) - debugfs_remove_recursive(uvc_debugfs_root_dir); + debugfs_remove_recursive(uvc_debugfs_root_dir); }