From patchwork Wed May 11 07:26:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 571739 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBF32C433F5 for ; Wed, 11 May 2022 07:16:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241144AbiEKHQG (ORCPT ); Wed, 11 May 2022 03:16:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242772AbiEKHQB (ORCPT ); Wed, 11 May 2022 03:16:01 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B1D627FCA for ; Wed, 11 May 2022 00:16:00 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id q4so1017224plr.11 for ; Wed, 11 May 2022 00:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=zxkHyeD5cX6Is8wQKGtDrQyW1I6vsy8eIPj5EcMUUfw=; b=dIXzbeA7PBa7qa4Xvpdas7nAhE7HLoH8k10DMEnJ+BGMMMxAKdcB/BTF/FSfcEB6KZ mXsJ+7L9u05jKT6m8KaDlDIhuGb4WKBRrtkfNNlomCoScvGkeWGX8O+UZsEvAqcrYTAA HHHtP9lOlMexh/a9YpPuYh4fHGOUdT3rysVfQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=zxkHyeD5cX6Is8wQKGtDrQyW1I6vsy8eIPj5EcMUUfw=; b=VID8+1wJyMvuu13oN+XLMK6orCJsaAbTJHepuAiqH+acT+W6XssgX+U4npgZuCra/b z0jaCHH09BLGqdrPP06+Es9p1GKhrbu4k7ZPIpKVA9Sd8J22RAXy9jjoWb/txyAz/euE o9N3YJdxK3CwR6G6Dxebj4D0kHFq2nGZp412wYvhMGcSCJkwvb60+IxSj4mZqWwAggZv /ldc2LXVC4Tz1olez64abYLmuCK6SdMPxXpFa8qe/QaHLYUVye7C/9z9hqJAFkBN2RPn vA97fe2P4H8X5yAgKcPQd6d3dPqwTgC5W5gMPnacvWsbXENRYhlyST7FV3hfmkvcVyvy yctg== X-Gm-Message-State: AOAM5312Gn52McIVb0QiG0QDyec4wMTlO7Wkz2Ia1ofkJ1qh5EDzApTj oqXcjMCLJycvaJ7CflRgQ7e0W05sQZvK/O87IaoSCX0ckP1MMNMivIYxECnJGagM5rocdZHOnrV Whw3XH+i2Xdov6p0g+RodOumPjxD021kEbFv8yaEcaw1BKf5Jxh3vaRBw3Ir5XDna77woL7IlJL Ypqoq7bJi4Rgc= X-Google-Smtp-Source: ABdhPJyvzGcB+oi29/pvnmoH5Urf6hrlijxMIXgxH4zcPg7SkLYgtoku4ebxEJL2vx6XFi0YTWt3UQ== X-Received: by 2002:a17:903:22ca:b0:15e:cf4e:79d6 with SMTP id y10-20020a17090322ca00b0015ecf4e79d6mr24724683plg.59.1652253359547; Wed, 11 May 2022 00:15:59 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id a8-20020aa78e88000000b0050dc76281bfsm801596pfr.153.2022.05.11.00.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 May 2022 00:15:58 -0700 (PDT) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, Sreekanth Reddy Subject: [PATCH] mpt3sas: Fix junk chars displayed while printing ChipName Date: Wed, 11 May 2022 12:56:20 +0530 Message-Id: <20220511072621.30657-1-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Make sure to append '/0' character after copying 16 bytes ChipName data from Manufacturing Page0. So that %s won't prints any junk characters. Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 4961be5..37d46ae 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;