summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSreekanth Reddy <sreekanth.reddy@broadcom.com>2022-05-11 12:56:20 +0530
committerMartin K. Petersen <martin.petersen@oracle.com>2022-05-19 20:16:25 -0400
commit8e129add48e0c35a8f1bf5df91f50a438dd75ba6 (patch)
treeb9f6175466c2764de06f20405c6d3a4129695cfa
parentaabd5fea49461c7b3a70d7aaa965e8cb3f19b7e7 (diff)
downloadlinux-8e129add48e0c35a8f1bf5df91f50a438dd75ba6.tar.bz2
scsi: mpt3sas: Fix junk chars displayed while printing ChipName
Terminate string after copying 16 bytes of ChipName data from Manufacturing Page0 to prevent %s from printing junk characters. Link: https://lore.kernel.org/r/20220511072621.30657-1-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 4961be5d527b..37d46ae5c61d 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -4753,7 +4753,7 @@ static void
_base_display_ioc_capabilities(struct MPT3SAS_ADAPTER *ioc)
{
int i = 0;
- char desc[16];
+ char desc[17] = {0};
u32 iounit_pg1_flags;
u32 bios_version;