diff options
| -rw-r--r-- | drivers/target/target_core_pr.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 157368429a51..26c1f2d8920f 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c | |||
| @@ -1932,13 +1932,13 @@ out: | |||
| 1932 | */ | 1932 | */ |
| 1933 | static int __core_scsi3_write_aptpl_to_file( | 1933 | static int __core_scsi3_write_aptpl_to_file( |
| 1934 | struct se_device *dev, | 1934 | struct se_device *dev, |
| 1935 | unsigned char *buf, | 1935 | unsigned char *buf) |
| 1936 | u32 pr_aptpl_buf_len) | ||
| 1937 | { | 1936 | { |
| 1938 | struct t10_wwn *wwn = &dev->t10_wwn; | 1937 | struct t10_wwn *wwn = &dev->t10_wwn; |
| 1939 | struct file *file; | 1938 | struct file *file; |
| 1940 | int flags = O_RDWR | O_CREAT | O_TRUNC; | 1939 | int flags = O_RDWR | O_CREAT | O_TRUNC; |
| 1941 | char path[512]; | 1940 | char path[512]; |
| 1941 | u32 pr_aptpl_buf_len; | ||
| 1942 | int ret; | 1942 | int ret; |
| 1943 | 1943 | ||
| 1944 | memset(path, 0, 512); | 1944 | memset(path, 0, 512); |
| @@ -1957,8 +1957,7 @@ static int __core_scsi3_write_aptpl_to_file( | |||
| 1957 | return PTR_ERR(file); | 1957 | return PTR_ERR(file); |
| 1958 | } | 1958 | } |
| 1959 | 1959 | ||
| 1960 | if (!pr_aptpl_buf_len) | 1960 | pr_aptpl_buf_len = (strlen(buf) + 1); /* Add extra for NULL */ |
| 1961 | pr_aptpl_buf_len = (strlen(&buf[0]) + 1); /* Add extra for NULL */ | ||
| 1962 | 1961 | ||
| 1963 | ret = kernel_write(file, buf, pr_aptpl_buf_len, 0); | 1962 | ret = kernel_write(file, buf, pr_aptpl_buf_len, 0); |
| 1964 | 1963 | ||
| @@ -1993,7 +1992,7 @@ core_scsi3_update_and_write_aptpl(struct se_device *dev, unsigned char *in_buf, | |||
| 1993 | * __core_scsi3_write_aptpl_to_file() will call strlen() | 1992 | * __core_scsi3_write_aptpl_to_file() will call strlen() |
| 1994 | * on the passed buf to determine pr_aptpl_buf_len. | 1993 | * on the passed buf to determine pr_aptpl_buf_len. |
| 1995 | */ | 1994 | */ |
| 1996 | return __core_scsi3_write_aptpl_to_file(dev, buf, 0); | 1995 | return __core_scsi3_write_aptpl_to_file(dev, buf); |
| 1997 | } | 1996 | } |
| 1998 | 1997 | ||
| 1999 | static sense_reason_t | 1998 | static sense_reason_t |
