From patchwork Fri Jan 25 14:22:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 156594 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp417512jaa; Fri, 25 Jan 2019 06:22:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN7qt8XHGDA14KlNqF/CraB3IkIUM6/vRhjvtkRRgh2COWQvRXJjqpzZmh5FdKw+AigBo7oo X-Received: by 2002:a63:6704:: with SMTP id b4mr10181929pgc.100.1548426137031; Fri, 25 Jan 2019 06:22:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548426137; cv=none; d=google.com; s=arc-20160816; b=Ux77k0ZBNL5kru6suymLULPB4PLoK6BmTnHS1nZsgvqJTOEgUFoK3fTvVLi89kcC7I k2I7PVQeI4aiKwkKIOKuuxcPH/aVxYdo8Jfg7iGI0VwYdo++cMNgnCH3d6vE1f4dkGSA +Mf2O+fK76yTLBJX7kkd4JCBkOu5lqL0P5mwioSLRcisMkSizxALVxWy9qW1/el39HdZ XdaSbp74rlphcl5A0LFq1ceC1w6naQAKIBb7t8NEoejxS52sIrK9Ch2KEsexcY42i5RJ 8vW19HPAlYWAYuf3UlEQe2A8onTwm7fUn14DXbRwAsZV8FvUG3xTeyjfMzedcBZIZYXX 36Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=O7vmXXbzBoOsp7OnNY9SFJ2hwu0uG2ggCybQzphC2mw=; b=GqEr0qERBjC/3pk9i8iMhCLihWBzoKUkqelLyc7dfxiFFWVttstAdaXAhF4y9lYN+0 X89Fz0QCgSLy53aw2EBV+5X4QtUHBxUQvSZ/xVylCNMdt71MqbAhUDLoeuKr/ObeugCF Bqe4U4fm9AYjLZfJ79Wyg5AETgHIt0F39QaUldxEkurM6HD+CnzoiuP3OhWSSk7MifNK cQ4CaA+cKi/AvAbt1tuKV+BkzN3wdzKEskviA+DWW5eNjgw4Iw5/tNyhzu51N/hQpd6C 1f1+lX8w2T5QhSklCSgHWBRoE41M8o8W7eHEeLiV+YXoFJw6OD0FSgEB/P/zBEceCnUy DEmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t75si24975921pfa.170.2019.01.25.06.22.16; Fri, 25 Jan 2019 06:22:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729072AbfAYOWP (ORCPT + 31 others); Fri, 25 Jan 2019 09:22:15 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2764 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728936AbfAYOWK (ORCPT ); Fri, 25 Jan 2019 09:22:10 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 53177ACC1C4F67D353C1; Fri, 25 Jan 2019 22:21:59 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.408.0; Fri, 25 Jan 2019 22:21:53 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , "John Garry" Subject: [PATCH 10/13] scsi: hisi_sas: Correct memory allocation size for DQ debugfs Date: Fri, 25 Jan 2019 22:22:36 +0800 Message-ID: <1548426159-225679-11-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1548426159-225679-1-git-send-email-john.garry@huawei.com> References: <1548426159-225679-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luo Jiaxing Some sizes we allocate for debugfs structure is incorrect, so fix them. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 0a817e9..89f1bc5 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -2502,7 +2502,7 @@ static void hisi_sas_debugfs_snapshot_cq_reg(struct hisi_hba *hisi_hba) static void hisi_sas_debugfs_snapshot_dq_reg(struct hisi_hba *hisi_hba) { - int queue_entry_size = hisi_hba->hw->complete_hdr_size; + int queue_entry_size = sizeof(struct hisi_sas_cmd_hdr); int i; for (i = 0; i < hisi_hba->queue_count; i++) @@ -2945,7 +2945,7 @@ void hisi_sas_debugfs_init(struct hisi_hba *hisi_hba) } /* Alloc buffer for dq */ - sz = hisi_hba->hw->complete_hdr_size * HISI_SAS_QUEUE_SLOTS; + sz = sizeof(struct hisi_sas_cmd_hdr) * HISI_SAS_QUEUE_SLOTS; for (d = 0; d < hisi_hba->queue_count; d++) { hisi_hba->debugfs_cmd_hdr[d] = devm_kmalloc(dev, sz, GFP_KERNEL);