From patchwork Mon Apr 9 00:29:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132967 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp669796ljb; Sun, 8 Apr 2018 18:12:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49SrtT5iZda9ue2PQhUsacKpCTBo+3GRv/mAzfUM+mAR9KJTpfwuSRypxlxPQbVU0EWdQSg X-Received: by 10.99.173.7 with SMTP id g7mr23406291pgf.170.1523236342993; Sun, 08 Apr 2018 18:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523236342; cv=none; d=google.com; s=arc-20160816; b=ICfkvqcOA4DU09sz92fCM9jiWl3WoNWXGVZ8kYCJL3Dq2/hGwNISqj+c0Ddti/ynUu SLzM4BDEhJjHoqWmXcQSO7T0Nu3oD4N9w6OCxQRKk+E1PDfRlSOWJITnWPYIeACoUL66 cM1v403On9WZYvZfrYX+UFb+o7QgBU9wgDZ+noGqPUqAdPyMbzNxT5DzFIH4gcMIkKXm OqbOWmCRdqvJwrB1zwSGJVGuTPgw2r0aSVU3iBAw6w4/v8KjGGhfCzsw4UiXpeGEUZus 8T8KIG2nPIcsdytlp+D0hBs210KEZWhxsRZbD9ol9Vn2Rhy8w7+NTHJEg8bME1l/i05f ZhUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Ho7g9+OqnT/q3kvQRcOOxz9RNGESi9fXP7IDt6pKcwk=; b=GXUdPt8/s2LSx8jVYEdcB/dM47tZvV39Mgysp4iwhMZrU0T+9kkJZiwW4J4FwIhAaW be/rfE+WhoJrqHNYNEIpH71oZlJuMNW3ZxxxPvgT8UU6mklImsC7qVt9ds3Il4WOEG95 F+N6we7I695PzdGexHoiC+weKFFnTorsxewe5Gfw/bxW/+KRYcgK/F+6N/YHS0DAfJvi zf93W4h9+OIUCpPEDc7wX0yXauIlONwroMIDZpOh1/XFj4kZ5pFOO5dHXHS3feSe1aSP p+RiKl+sYW3yJicGoAyJJTwyWuOnLDovmxMZhe/Z0lOGzkfwcE6CCz9rzWWTPvinEEgI niww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e2jMOMQ1; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1-v6si11187287plh.375.2018.04.08.18.12.22; Sun, 08 Apr 2018 18:12:22 -0700 (PDT) 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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e2jMOMQ1; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932178AbeDIBME (ORCPT + 29 others); Sun, 8 Apr 2018 21:12:04 -0400 Received: from mail-co1nam03on0129.outbound.protection.outlook.com ([104.47.40.129]:43760 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932989AbeDIAil (ORCPT ); Sun, 8 Apr 2018 20:38:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Ho7g9+OqnT/q3kvQRcOOxz9RNGESi9fXP7IDt6pKcwk=; b=e2jMOMQ1hgRsg/uEnuIqCFCLtg33BlsbF3TaHOWHO0a1Di5uvSIPOC4Bo/JbTUCT4C61IetHANfuI5kVMZohr3cX47DhSLzQ58MEniNIsgvAdV79WFjIg/uMmT0RutNIgv7p3VDR0bOLVTYvzyQg62FwJhU7IRS2LpipcwcTuWI= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1095.namprd21.prod.outlook.com (52.132.130.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:38:35 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:38:35 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Arnd Bergmann , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 129/162] scsi: fas216: fix sense buffer initialization Thread-Topic: [PATCH AUTOSEL for 4.4 129/162] scsi: fas216: fix sense buffer initialization Thread-Index: AQHTz5nQsIISFIovaEKhcaM0LAaenA== Date: Mon, 9 Apr 2018 00:29:25 +0000 Message-ID: <20180409002738.163941-129-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1095; 7:j5QP7AcTl3YE8OBe4Y+j1fDOukOq4KIumks3ruLWx9+LF3jw8a5HwAYG/Sxd9551b9QhkMYHh3U/2M4xFKPAQupasqmbJsK32mS7ezRykuicEPJZ4ymiz7U28jnAv7D3tjUD3J8oIQPDw/H0FwcR8/IFLc9L3YyN3IqucbUxMwwUOvwCQXqME1JVPH3Xg2OEQRQsEdw84X2371+mJWN78h7BibcP7QdVWSMXqCsQY8f8kkwUN8PFyW1XOc7kSAkj; 20:bMBUAgzNGjd6TwFqruEAues5YyuKBO++9i+UkExT3mtwKtPZFtNlqZYyOvqfLWoqZythBMaN/XPkM98JHNhRYsqP8bLaF8KOaQnqB5iIreNLLRB8IY/aog+AP2o46IoujrjgMsh8bcX1X4zUsC20+F8J9RLbd6QZ20IY35TutF8= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 1663cbcf-2687-4af7-c121-08d59db23a8a x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1095; x-ms-traffictypediagnostic: DM5PR2101MB1095: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011); SRVR:DM5PR2101MB1095; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1095; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39380400002)(346002)(366004)(396003)(39860400002)(376002)(189003)(199004)(26005)(10090500001)(476003)(105586002)(86362001)(107886003)(11346002)(446003)(2616005)(102836004)(76176011)(6512007)(97736004)(36756003)(6666003)(6506007)(8676002)(59450400001)(99286004)(4326008)(10290500003)(81156014)(86612001)(81166006)(186003)(486006)(2900100001)(106356001)(1076002)(72206003)(478600001)(305945005)(8936002)(25786009)(3660700001)(7736002)(68736007)(66066001)(110136005)(316002)(54906003)(3280700002)(2906002)(3846002)(6116002)(6436002)(53936002)(6486002)(22452003)(2501003)(5250100002)(14454004)(5660300001)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1095; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: iLYuqqKqNdUfgItSw+KmkeU4mTOoSxlZIWUDuVnTJxB5sfzZWp6QL5DG6o1K0Pr7vxHn0gdY9z85Ur1rK2PCMVPMq1JgRs5PJ/Yr7BhzD1TQGcUiNJaoGbPpn8uygYKuK1negcXhm6ZtDurDt7SwVp1I+jwNZ4cLxoIXJOSqp8o9Xz7rftUDlDNK5eWpUzIQxOJ2eh4y5lTFKIylhfy0F+5IExsYiEwUH7kzXT2xGwaj4dKd9wZMGKPnRkFPj4WUIvyaIAd37W73Q1BKyUL4nO/MwCNFTqq0xfqnLSyEuOWDNBvoWb8NLso4Q/0dTOgoGK02uUXpPHVoQcwmETFKd2uEyAFP1qyHIn7249Tkhhpe8IyZ6lpDt8UdYus4AiZ32r2NM9iyvh/20LZddmpgsziMVgCm7GCHnTbBJS1lIPI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1663cbcf-2687-4af7-c121-08d59db23a8a X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:29:25.9900 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1095 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 96d5eaa9bb74d299508d811d865c2c41b38b0301 ] While testing with the ARM specific memset() macro removed, I ran into a compiler warning that shows an old bug: drivers/scsi/arm/fas216.c: In function 'fas216_rq_sns_done': drivers/scsi/arm/fas216.c:2014:40: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess] It turns out that the definition of the scsi_cmd structure changed back in linux-2.6.25, so now we clear only four bytes (sizeof(pointer)) instead of 96 (SCSI_SENSE_BUFFERSIZE). I did not check whether we actually need to initialize the buffer here, but it's clear that if we do it, we should use the correct size. Fixes: de25deb18016 ("[SCSI] use dynamically allocated sense buffer") Signed-off-by: Arnd Bergmann Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/arm/fas216.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.15.1 diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c index decdc71b6b86..f6d7c4712e66 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c @@ -2009,7 +2009,7 @@ static void fas216_rq_sns_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, * have valid data in the sense buffer that could * confuse the higher levels. */ - memset(SCpnt->sense_buffer, 0, sizeof(SCpnt->sense_buffer)); + memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); //printk("scsi%d.%c: sense buffer: ", info->host->host_no, '0' + SCpnt->device->id); //{ int i; for (i = 0; i < 32; i++) printk("%02x ", SCpnt->sense_buffer[i]); printk("\n"); } /*