diff options
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
| -rw-r--r-- | drivers/scsi/scsi_debug.c | 9 | 
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 67922e2c4c19..6d8218a44122 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -1019,7 +1019,7 @@ static ssize_t sdebug_error_write(struct file *file, const char __user *ubuf,  	struct sdebug_err_inject *inject;  	struct scsi_device *sdev = (struct scsi_device *)file->f_inode->i_private; -	buf = kmalloc(count, GFP_KERNEL); +	buf = kzalloc(count + 1, GFP_KERNEL);  	if (!buf)  		return -ENOMEM; @@ -1132,7 +1132,6 @@ static const struct file_operations sdebug_target_reset_fail_fops = {  static int sdebug_target_alloc(struct scsi_target *starget)  {  	struct sdebug_target_info *targetip; -	struct dentry *dentry;  	targetip = kzalloc(sizeof(struct sdebug_target_info), GFP_KERNEL);  	if (!targetip) @@ -1140,15 +1139,9 @@ static int sdebug_target_alloc(struct scsi_target *starget)  	targetip->debugfs_entry = debugfs_create_dir(dev_name(&starget->dev),  				sdebug_debugfs_root); -	if (IS_ERR_OR_NULL(targetip->debugfs_entry)) -		pr_info("%s: failed to create debugfs directory for target %s\n", -			__func__, dev_name(&starget->dev));  	debugfs_create_file("fail_reset", 0600, targetip->debugfs_entry, starget,  				&sdebug_target_reset_fail_fops); -	if (IS_ERR_OR_NULL(dentry)) -		pr_info("%s: failed to create fail_reset file for target %s\n", -			__func__, dev_name(&starget->dev));  	starget->hostdata = targetip;  | 
