bfa: use strncpy() instead of memcpy()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 30 Jan 2016 14:36:03 +0000 (17:36 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 24 Feb 2016 02:27:02 +0000 (21:27 -0500)
BFA_MFG_NAME is "QLogic" which is only 7 bytes, but we are copying 8
bytes.  It's harmless because the badding byte is likely zero but it
makes static checkers complain.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/bfa/bfa_ioc.c

index 251e2ff8ff5f797848b9603fdfff2d4fdc5eea71..a1ada4a31c9717f32d4660d3e50f6a7dfc1776c9 100644 (file)
@@ -2803,7 +2803,7 @@ void
 bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc, char *manufacturer)
 {
        memset((void *)manufacturer, 0, BFA_ADAPTER_MFG_NAME_LEN);
-       memcpy(manufacturer, BFA_MFG_NAME, BFA_ADAPTER_MFG_NAME_LEN);
+       strncpy(manufacturer, BFA_MFG_NAME, BFA_ADAPTER_MFG_NAME_LEN);
 }
 
 void