lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <289fc09c-8ccb-c3a9-e740-af06687e7121@users.sourceforge.net>
Date:	Sun, 17 Jul 2016 22:16:19 +0200
From:	SF Markus Elfring <elfring@...rs.sourceforge.net>
To:	linux-media@...r.kernel.org, devel@...verdev.osuosl.org,
	Mauro Carvalho Chehab <mchehab@....samsung.com>,
	Krzysztof HaƂasa <khalasa@...p.pl>,
	Hans Verkuil <hans.verkuil@...co.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH] [media] tw686x-kh: Delete an unnecessary check before the
 function call "video_unregister_device"

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sun, 17 Jul 2016 22:00:35 +0200

The video_unregister_device() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/staging/media/tw686x-kh/tw686x-kh-video.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/tw686x-kh/tw686x-kh-video.c b/drivers/staging/media/tw686x-kh/tw686x-kh-video.c
index 6ecb504..3f2830c 100644
--- a/drivers/staging/media/tw686x-kh/tw686x-kh-video.c
+++ b/drivers/staging/media/tw686x-kh/tw686x-kh-video.c
@@ -643,8 +643,7 @@ void tw686x_kh_video_free(struct tw686x_dev *dev)
 		struct tw686x_video_channel *vc = &dev->video_channels[ch];
 
 		v4l2_ctrl_handler_free(&vc->ctrl_handler);
-		if (vc->device)
-			video_unregister_device(vc->device);
+		video_unregister_device(vc->device);
 		vb2_dma_sg_cleanup_ctx(vc->alloc_ctx);
 		for (n = 0; n < 2; n++) {
 			struct dma_desc *descs = &vc->sg_tables[n];
-- 
2.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ