From patchwork Mon Apr 9 00:17:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132943 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp636989ljb; Sun, 8 Apr 2018 17:18:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx48c38Xoz8GbYyNiJFSTE3shX7nZ0ERoPJmWacx8ixXx+xMnsxb+lJpiI29zWjqk4kHjnuY9 X-Received: by 10.99.126.73 with SMTP id o9mr13617302pgn.168.1523233124038; Sun, 08 Apr 2018 17:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523233124; cv=none; d=google.com; s=arc-20160816; b=enSNFQRIk34R7s9wW87k5NOfHDfQeYzXINfY0Vz0INcz+z+Z8a3sxg41FPPBQhkEnU uWXY1lDNGivLTCijI14i/HrexLvB55eLB9BS3bm/gl3C3sIg00owT5FBGH7SA/9i+8zG aDv2L1OURlhiyzmgJ8KBYuockrEB+4VRu+6oBckVOkW4rAPfTIjYl1A99Z8dETJ98/Cv Bt8bcZ7BtMue7DSmWuEPESGgpkri6X9ea/6Ne+lQdOUhR2eyDa6FvBgM+ypNedTtms8m K9duJRBjwPqJFI0t45K8CE+GugF0ur8PSuMwL8A/XPdufXTwAauYpgKkatGa5m40NkRt gdaQ== 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=JrZlP1LNfCvfcFgx75Yp7WZLD1ONIdpNnq34ca9XnmA=; b=Xc1KaiennfG+ZJpJinwXj8feD+oF4RmZ/ZPctnWOiY9HwqjS1fhbk/L9WDRlmYHMs9 XjOyy9pXSSNKmvMEZjo1ItVzed85+0xf3LDbRij4XdH5Ym7+UO/sbp5UffjKE6aeUUtq Om+tiswMqkYkgVIIsFldTg0CfEStMKDKlBRBMh0p3OMxTrK+eBm5I2Lm0uFW0akZ29JP s6cLak+DE1XdsmoKhclNQbQTY9jfrd96ZBlgC5MSGVAq76BrklKsrD/WogDevdoeF+gZ TYhW1Vtv91sG+s4fqqNAV7zBBxIwqr2cYRLntODWCEEXT/eLmfgjtuoE2TxDECYcXbN5 EIPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=XYu0wb3r; 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 h23-v6si1201721plr.576.2018.04.08.17.18.43; Sun, 08 Apr 2018 17:18:44 -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=XYu0wb3r; 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 S1753721AbeDIASk (ORCPT + 29 others); Sun, 8 Apr 2018 20:18:40 -0400 Received: from mail-bn3nam01on0092.outbound.protection.outlook.com ([104.47.33.92]:62923 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753651AbeDIASg (ORCPT ); Sun, 8 Apr 2018 20:18:36 -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=JrZlP1LNfCvfcFgx75Yp7WZLD1ONIdpNnq34ca9XnmA=; b=XYu0wb3rMpSr588R8bBXcuOBmhEgLFzVHLTvKNaJWwVBfU/8oiBUhzqDL3O7nAkPooDCD0KAgAC5Ue0bAJdy2M+R2bbdm+XcZOnSV8spRX10tR13OMSwvMggWb3o6KJI7uy6p234D4Zsf7rR7Nf0l2IHBeA67EBASx6JHxmMwR8= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1128.namprd21.prod.outlook.com (52.132.133.20) 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:18:33 +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:18:33 +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.15 071/189] scsi: fas216: fix sense buffer initialization Thread-Topic: [PATCH AUTOSEL for 4.15 071/189] scsi: fas216: fix sense buffer initialization Thread-Index: AQHTz5gs2rk9mt+1K0WTigtL2+2RBA== Date: Mon, 9 Apr 2018 00:17:40 +0000 Message-ID: <20180409001637.162453-71-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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; DM5PR2101MB1128; 7:ZhtAL8ao2esnzUJ030i0GtjVNp44e5UwhegzbnQU0LIrCHTvyqRI3adSoye8TJTUUQtm1/kL71uJnCFA6whWINRFn7cU9JpeYSGM1soyXgf6wwGJ381n+4CqqU42IqM50HacCrgv+Bi26r81BHyseYJCwmBnWeEA7DvQjXsdtG4/gfo2aTQ7iukj96gtCGiiioAJhOBEXyzQpf7Mvt+WngMFGKni0+S2RDkpLXHd8jV5jlIbIjnZogZakK1YoOp0; 20:F6VyFicORVU33qM4VoQVn/GYZsUnb2Kg6qcBtxZm4+VtOrJ/CbFl/J408QSYWLauL4+VoWN8o71FlV8Q3nZWLzftOz8JR6YIWW+L3Y3C+aQRH5Eozy5zmeO7djPr9sp9J6WchVrNFdNRoQO7WuYlN02Cz3Fr+7jNA23cNqHXRbs= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 0b481ede-335f-4308-6612-08d59daf6e56 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1128; x-ms-traffictypediagnostic: DM5PR2101MB1128: 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)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR2101MB1128; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1128; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39860400002)(396003)(376002)(366004)(39380400002)(199004)(189003)(66066001)(86362001)(59450400001)(3660700001)(3280700002)(2900100001)(25786009)(36756003)(6506007)(76176011)(2906002)(6486002)(86612001)(99286004)(102836004)(1076002)(7736002)(97736004)(2616005)(446003)(486006)(11346002)(476003)(26005)(305945005)(6666003)(6512007)(4326008)(107886003)(478600001)(6436002)(5660300001)(10290500003)(5250100002)(22452003)(316002)(105586002)(186003)(8676002)(110136005)(54906003)(72206003)(53936002)(2501003)(68736007)(14454004)(6116002)(8936002)(3846002)(81156014)(10090500001)(106356001)(81166006)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1128; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: rwbVFjLdxV1BlPKscujAHKk+TZZQXFIuXE4RSaen42fZSuNN1QhznvBetPlVCJVJRLwAgcTGHaVMVpK8FyOclEiq38g2NCutQEDj/E9rPTPVLXypGyezIbP8TFeZxSEklR+Ql4egsDAEfpeaay5NFZm7KnV0aII9f5EBMwzlEBbFPWZ1SHMt4ZftTJ5YtDdCYVW8p3q9bIxEmRpQaFYMYAG3ZbpI3sQ0cKD+ynY+0l2SEPgDEaURRM+2XWKNRfAtfqmz6mpdtGVJxG5MI8Cma876y2WD08BSN8Lo3mJcdV9DSVeaEQQ2m0Nc71soz/o7WQKcJM1dyGIyiC1rlw7b9RM8yBtg6IDIoJwyQMy1ZFtp+bou+OPgl5y5oGNh7u98AT5utYIRlsEWAKriJdo9rW7xBJ/r4gZz7r53y7v8bQU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b481ede-335f-4308-6612-08d59daf6e56 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:40.9460 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1128 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 f4775ca70bab..27bda2b05de6 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c @@ -2011,7 +2011,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"); } /*