Skip to content

Commit 037fbd3

Browse files
Dan Carpentermartinkpetersen
authored andcommitted
scsi: scsi_debug: Delete some bogus error checking
Smatch complains that "dentry" is never initialized. These days everyone initializes all their stack variables to zero so this means that it will trigger a warning every time this function is run. Really, debugfs functions are not supposed to be checked for errors in normal code. For example, if we updated this code to check the correct variable then it would print a warning if CONFIG_DEBUGFS was disabled. We don't want that. Just delete the check. Fixes: f084fe5 ("scsi: scsi_debug: Add debugfs interface to fail target reset") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/c602c9ad-5e35-4e18-a47f-87ed956a9ec2@moroto.mountain Reviewed-by: Wenchao Hao <haowenchao2@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 860c3d0 commit 037fbd3

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

drivers/scsi/scsi_debug.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,23 +1132,16 @@ static const struct file_operations sdebug_target_reset_fail_fops = {
11321132
static int sdebug_target_alloc(struct scsi_target *starget)
11331133
{
11341134
struct sdebug_target_info *targetip;
1135-
struct dentry *dentry;
11361135

11371136
targetip = kzalloc(sizeof(struct sdebug_target_info), GFP_KERNEL);
11381137
if (!targetip)
11391138
return -ENOMEM;
11401139

11411140
targetip->debugfs_entry = debugfs_create_dir(dev_name(&starget->dev),
11421141
sdebug_debugfs_root);
1143-
if (IS_ERR_OR_NULL(targetip->debugfs_entry))
1144-
pr_info("%s: failed to create debugfs directory for target %s\n",
1145-
__func__, dev_name(&starget->dev));
11461142

11471143
debugfs_create_file("fail_reset", 0600, targetip->debugfs_entry, starget,
11481144
&sdebug_target_reset_fail_fops);
1149-
if (IS_ERR_OR_NULL(dentry))
1150-
pr_info("%s: failed to create fail_reset file for target %s\n",
1151-
__func__, dev_name(&starget->dev));
11521145

11531146
starget->hostdata = targetip;
11541147

0 commit comments

Comments
 (0)