From patchwork Mon Apr 9 00:26:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132975 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp694906ljb; Sun, 8 Apr 2018 18:52:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx490aY9xGEDJ9Vl/z/FFEJiVdZrwlwWEPmXWrmtrinGDiU1Uk5TQymWHpmueeePoizs2ydTh X-Received: by 2002:a17:902:7d10:: with SMTP id z16-v6mr6769795pll.79.1523238734999; Sun, 08 Apr 2018 18:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523238734; cv=none; d=google.com; s=arc-20160816; b=0v6G7mYZfA4SAKXAw3QdMgbGSGWfz0IbAJfpC+UXhn5kTNzYnFAblI9dM7NEvtV3Hs HWkJSR1DpQLjhiQqAo30d6kUJx+RSk9P4gkWjbOu4PzIFHXx3j2aQk/+hcS3VbKQtr2j pUpx7IlzPOnaiYKTFTApU0OxrGCIEA9EcBMkwDHzwQrf1tL7aiNy02+ciWcgqql4Amii I50xtkp5aHdUzhDfH1fL2uXWXHO6HEg5AIXPGSZHq/xnB3QWfWw3O7+ENdkCllNJADZP G5D58zFVoIXnxwA/CldDhz7n6nrtpaulRpoJtfMoa2F+KEza/ztJzzzVD6MtqbvX1BdD qKCw== 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=hzMZY3DaNp1nbYji6bW4VPw/geV/k1dXAuXCwXMydOM=; b=NL2BXo/mEKoYxsrjllux6i6OyOyeNj7by6Gggti+342W3a3G3V69gSKWRVechvfiMa OPbRlNd7CJo+ikYmvn+js+Nd0XXhikh3L8r6MvYHyAWZrVuL1nHFze8CTC0xlU93+Vo7 qatNQR+GAn4faxCRXjsQx+jVnuATE425UHWs05d6EGaFf4w0wtEROGoQ9IlaypdxFA9q OVIFO/0VDm5Igh7w/qxP7A0ZI+sVuNthtRBKauUKhCLF3tMI+asxW3MpsKqBQMLRQqwb A2kHIxmdlcGzW100bbvvRZ5Ojzfo8pNEULWe+LXtAb2/K/6Jmzy4xNXeqBNOw1etc4zm TzGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=PD6DbnXk; 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 g1-v6si13623313plm.747.2018.04.08.18.52.14; Sun, 08 Apr 2018 18:52:14 -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=PD6DbnXk; 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 S932514AbeDIBwL (ORCPT + 29 others); Sun, 8 Apr 2018 21:52:11 -0400 Received: from mail-by2nam01on0111.outbound.protection.outlook.com ([104.47.34.111]:45024 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932314AbeDIAdq (ORCPT ); Sun, 8 Apr 2018 20:33:46 -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=hzMZY3DaNp1nbYji6bW4VPw/geV/k1dXAuXCwXMydOM=; b=PD6DbnXkNWN9z24QmZnKSUpZL3fe6Dl6rDi0qjdxUIMd6q47ZkRi1LbYkCIwVx0/nEyV8Yu0UmMHHxdzGvbK0yA1+N5N8lA3Xo638gmstAxv1YRv8/l5reBESPQFtAYSfcvMuxwCo+PYZe54p2EF4QQ2An5HtLPb94DhMOp10cU= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0998.namprd21.prod.outlook.com (52.132.133.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.0; Mon, 9 Apr 2018 00:33:41 +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:33:41 +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.9 242/293] scsi: fas216: fix sense buffer initialization Thread-Topic: [PATCH AUTOSEL for 4.9 242/293] scsi: fas216: fix sense buffer initialization Thread-Index: AQHTz5lWAfCMa5Mec0+j7LDQ0b3ueA== Date: Mon, 9 Apr 2018 00:26:01 +0000 Message-ID: <20180409002239.163177-242-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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; DM5PR2101MB0998; 7:fCmh6uljZ2wRqcouWNXS5kNp0fH5PqRwZofrawLe8JaYDKoY7v9UuuGb18JIdAKvi5NPhJCF2kivI9t+oZtFKmCt8Hr2i4Y/yGGhJ9UezZff8z2REk+nWYFOq4YA+B1BX5DuNpB4rNPn8OICb1yXcF2SrWTKNBrqIyLp6LoGU+bRLYvhQjLD6HLzy64zYFSrJWpRU7dUEeVk5kb9Dmn9vdXPigLWQw47EuPg1PTtixdP9oxlbK8H3pj4RLPPesDW; 20:ycYtFjhN8wzdwa+U9O+kAsCxVYgEB7hb6jvmXO4WE66MN/9fKYcuaxNoio/Lk8xFSMXS0ywAMwCoevXsLB8qPdkj5liUSulqAMEIwVwP2Jn+QmxTl+DxPm6QECq29oK1e6bDK9EJj53/DnSx5/KXeF9yJVqheM4ZRJQofORv5ls= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: c66edbea-979a-40fd-f808-08d59db18b81 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB0998; x-ms-traffictypediagnostic: DM5PR2101MB0998: 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)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:DM5PR2101MB0998; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0998; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(979002)(346002)(39380400002)(376002)(396003)(366004)(39860400002)(189003)(199004)(25786009)(59450400001)(105586002)(14454004)(76176011)(68736007)(2906002)(316002)(97736004)(8676002)(86612001)(3660700001)(3280700002)(102836004)(6116002)(4326008)(8936002)(36756003)(22452003)(81166006)(81156014)(54906003)(6506007)(10090500001)(2501003)(6512007)(186003)(6666003)(3846002)(486006)(5660300001)(26005)(7736002)(5250100002)(305945005)(99286004)(2900100001)(110136005)(1076002)(6436002)(53936002)(106356001)(107886003)(72206003)(86362001)(476003)(446003)(66066001)(11346002)(478600001)(10290500003)(2616005)(6486002)(22906009)(217873001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0998; 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: O6Zo/LxLhsnv0BKTawD1Euoq4+g8hcUQCHCGpNq+G0UH3fxSmCfN++n7jcFM3Hdj/sX9xkoNG2oFNrRSyxHEDDpX07IqryVr93FUDVbuPksB/PkHcnnbp9GYJjyCgqYwjD7PisrN9ewf77X4zGg9RFhdLvAmPuKP5BwDHnL4rE9Iug9AYTT6+6+yJnPlGUNHQrPsguH4NKFBPeBX2lbuosAZ4hCtUYRZcBR/768LSJS6MqCAXGnZvTx7235JMpBgaR/7drqTMmWIxd+brWDfLS6J7ai9eRrHUUbQgIIx35s+mPuARZBz6f5bpkMyzOmC3Fp25cOt5cYETIn9Wd2buP90b4DVk3Eu32wpUvNCzES5MkvvKiLVao/3ZHiCTLLEqIY3DW6D9aJZQv5Yq/jCNZCC3yEfqamrv3amSItiS9M= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c66edbea-979a-40fd-f808-08d59db18b81 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:26:01.7849 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0998 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 24388795ee9a..936e8c735656 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"); } /*