linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* block: remove dead code in scsi_ioctl:blk_verify_command
@ 2014-05-29 19:11 Dave Jones
  2014-05-29 19:39 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2014-05-29 19:11 UTC (permalink / raw)
  To: Linux Kernel; +Cc: linux-scsi, axboe

filter gets assigned the address of blk_default_cmd_filter on
entry to this function, so the !filter condition can never be true.

Signed-off-by: Dave Jones <davej@redhat.com>

diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 26487972ac54..9c28a5b38042 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -205,10 +205,6 @@ int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm)
 	if (capable(CAP_SYS_RAWIO))
 		return 0;
 
-	/* if there's no filter set, assume we're filtering everything out */
-	if (!filter)
-		return -EPERM;
-
 	/* Anybody who can open the device can do a read-safe command */
 	if (test_bit(cmd[0], filter->read_ok))
 		return 0;

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

end of thread, other threads:[~2014-05-29 19:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-29 19:11 block: remove dead code in scsi_ioctl:blk_verify_command Dave Jones
2014-05-29 19:39 ` Jens Axboe

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).