linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: uvc_debugfs: remove unnecessary NULL check before debugfs_remove_recursive
@ 2017-11-12  8:18 Gustavo A. R. Silva
  2018-08-06 22:48 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2017-11-12  8:18 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Gustavo A. R. Silva

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 <garsilva@embeddedor.com>
---
 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);
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-07  0:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-12  8:18 [PATCH] usb: uvc_debugfs: remove unnecessary NULL check before debugfs_remove_recursive Gustavo A. R. Silva
2018-08-06 22:48 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).