diff options
| author | Dominique Martinet <asmadeus@codewreck.org> | 2018-07-12 21:25:56 -0400 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-07-30 23:17:53 -0400 |
| commit | a544523887007ba2b6bd73419c4e2f0ab9bb3633 (patch) | |
| tree | 7fac2e3b91fefacb4080fb18661b44824910f013 /drivers/scsi/ibmvscsi | |
| parent | 7bd1d615a57f3356f41b0079a3fb9ee77ae00a82 (diff) | |
scsi: ibmvscsi: change strncpy+truncation to strlcpy
Generated by scripts/coccinelle/misc/strncpy_truncation.cocci
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ibmvscsi')
| -rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 02689298325b..9df8a1a2299c 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
| @@ -1274,14 +1274,12 @@ static void send_mad_capabilities(struct ibmvscsi_host_data *hostdata) | |||
| 1274 | if (hostdata->client_migrated) | 1274 | if (hostdata->client_migrated) |
| 1275 | hostdata->caps.flags |= cpu_to_be32(CLIENT_MIGRATED); | 1275 | hostdata->caps.flags |= cpu_to_be32(CLIENT_MIGRATED); |
| 1276 | 1276 | ||
| 1277 | strncpy(hostdata->caps.name, dev_name(&hostdata->host->shost_gendev), | 1277 | strlcpy(hostdata->caps.name, dev_name(&hostdata->host->shost_gendev), |
| 1278 | sizeof(hostdata->caps.name)); | 1278 | sizeof(hostdata->caps.name)); |
| 1279 | hostdata->caps.name[sizeof(hostdata->caps.name) - 1] = '\0'; | ||
| 1280 | 1279 | ||
| 1281 | location = of_get_property(of_node, "ibm,loc-code", NULL); | 1280 | location = of_get_property(of_node, "ibm,loc-code", NULL); |
| 1282 | location = location ? location : dev_name(hostdata->dev); | 1281 | location = location ? location : dev_name(hostdata->dev); |
| 1283 | strncpy(hostdata->caps.loc, location, sizeof(hostdata->caps.loc)); | 1282 | strlcpy(hostdata->caps.loc, location, sizeof(hostdata->caps.loc)); |
| 1284 | hostdata->caps.loc[sizeof(hostdata->caps.loc) - 1] = '\0'; | ||
| 1285 | 1283 | ||
| 1286 | req->common.type = cpu_to_be32(VIOSRP_CAPABILITIES_TYPE); | 1284 | req->common.type = cpu_to_be32(VIOSRP_CAPABILITIES_TYPE); |
| 1287 | req->buffer = cpu_to_be64(hostdata->caps_addr); | 1285 | req->buffer = cpu_to_be64(hostdata->caps_addr); |
