From patchwork Mon Apr 9 00:41:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132958 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp654345ljb; Sun, 8 Apr 2018 17:47:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+GPwijb9uFLRlDyDR0/lo18BlTydyOhv+rGWLvZf+lhXIngOzdB111yTppAKKLztD5mvyD X-Received: by 2002:a17:902:1007:: with SMTP id b7-v6mr19873779pla.205.1523234874481; Sun, 08 Apr 2018 17:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523234874; cv=none; d=google.com; s=arc-20160816; b=BjU7M3sfMNjg8uR1RlTRR3tjUBvRz9KJTvQESuDo0f1YzgZ8n+4EXelXWypRlGPebt tiFwgNtB3yo0LZhm4AgiYz4q+8EanMNu52DL2W3SFN3Dl5XkCmVtrNKUmumulEttHgPb R8OlmjAyKqxwvEBsOQSm63y6/X9lwjya5+l6+/saIV7t0tsUjhZXRZbSMNioS0cdwrBY cO//4muUJ1eZbd7oXpaImFW35F+pUHbmQmq0S4Xh1xfkm1g2kGfIM1sqVaDJ9rZNSvFl X4DITF8DbDqvShoOBLIX2ujmxBROJ6rM7QxmjxyErzMTuJeJqjxUaiCoq/DsTBXFYfx0 ++Rw== 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=cxuAOp+oG6MfqXk4+MG6pfPStGdA8brM5KfHHG4a8dU=; b=AKp14NgCzfzdLS38L0F2C+aOJJ76CuG63KfUKfCTQHoc3yDa7XgyPqqJjrNxFZhRTz 9F/Yyx/5pNtPxaUh9CBKIi+6VuUCkGpo4wOKwD9laNusFduBjOI1TqBgn0BTlB9DAYbp Mh2pm8NywXCDTbYpDR9CaBydbAGGMjOGpYv5adVS73AnDt8kllsnvNzbi6kg9L8M8o98 tMFU8MRQaz9vu6HAvyIAw9kNfL5oYf+Oeu/+jQe7EeYedlOVtd8AfY4xA498hCSuRjkt 6gZWS7v//J9OoJnbR3yvmT22feRd/GGXZ3jg4Sk2WnbnufgeUa7vGx7Ab3IiNOgEfo/5 +nSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=V9IunfQg; 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 b72si12002943pfk.135.2018.04.08.17.47.54; Sun, 08 Apr 2018 17:47:54 -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=V9IunfQg; 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 S1757012AbeDIArs (ORCPT + 29 others); Sun, 8 Apr 2018 20:47:48 -0400 Received: from mail-sn1nam02on0109.outbound.protection.outlook.com ([104.47.36.109]:10733 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756339AbeDIAlm (ORCPT ); Sun, 8 Apr 2018 20:41:42 -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=cxuAOp+oG6MfqXk4+MG6pfPStGdA8brM5KfHHG4a8dU=; b=V9IunfQgQdj0P67ugHiMi+KtBkpmAyptczymnoIfTMGs2yMml4OWxtxBNjRHqrXYXRVdsEpao+5c7gBnko90D7JubK6C8LMw3g4hm66Tqj0vpuQYPAbzOYq/1extdUFWcUAju5g2iyNtQJdVQWERhYvkNXI8D9DkO65YsUb960Q= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1062.namprd21.prod.outlook.com (52.132.128.19) 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:41:40 +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:41:40 +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 3.18 078/101] scsi: fas216: fix sense buffer initialization Thread-Topic: [PATCH AUTOSEL for 3.18 078/101] scsi: fas216: fix sense buffer initialization Thread-Index: AQHTz5uE9NxLRSkex02Is7m7uUFCww== Date: Mon, 9 Apr 2018 00:41:37 +0000 Message-ID: <20180409004042.164920-28-alexander.levin@microsoft.com> References: <20180409004042.164920-1-alexander.levin@microsoft.com> In-Reply-To: <20180409004042.164920-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; DM5PR2101MB1062; 7:v4HxZCuJEHWcnXnPqgfvl2izKmn67Ro1w06z4qJVHSJ6CRjhsowyyVnSmR91aBoT9+L6vYyicFp/uV+zhR39PGQQVqnRMvNQyKcY3WNO9wHvbmerS9UYzkzfSbT7vAKHthCKIhuY+EX5+Wa6uDi/TDYauddkX7ZxF+mCxR6KLcdXQ+UhqtuknCwGEi+SYXuogpzlmMJxMXtl0Jz80VChPaED/pLF+eFkgV+7Md4qsIA8u1sghlILJ5eTABd89oTG; 20:cBQXFvN4qJNan4iFXq/LJTDRZ/OIe+U+hIx6UzGK0E0qS3HDwIaRiF8Pi3rAklsPpgY1/oYt00ve8b3zB4uoFXkefrGLwHrToYvaoQ2uEC5uDpHKNDLLfz8QdX82NxGyIdvsHr909F3pHhpB+i9PhN9hgbvjQ4xdKJtiPwtJ9S4= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 8fa3eaf6-752f-42cb-476d-08d59db2a8e0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1062; x-ms-traffictypediagnostic: DM5PR2101MB1062: 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)(10201501046)(3231221)(944501327)(52105095)(93006095)(93001095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:DM5PR2101MB1062; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1062; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(39860400002)(376002)(39380400002)(396003)(346002)(199004)(189003)(68736007)(6512007)(316002)(486006)(6486002)(6666003)(54906003)(5660300001)(110136005)(102836004)(14454004)(99286004)(36756003)(86612001)(72206003)(105586002)(97736004)(106356001)(2906002)(22452003)(1076002)(2900100001)(10090500001)(6436002)(3660700001)(6116002)(3846002)(305945005)(59450400001)(86362001)(66066001)(10290500003)(3280700002)(5250100002)(25786009)(8676002)(81166006)(8936002)(7736002)(478600001)(476003)(81156014)(26005)(4326008)(186003)(2501003)(107886003)(6506007)(2616005)(76176011)(11346002)(446003)(53936002)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1062; 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: pDfdeRSFyeEdsYIufuOqj0t3WNlC+whISmY90+S6ygtgRXt0lbk8a1aYC9UpnpO5knvFqEUb/3THOkqJwxXzLz858q2ipOuyiU0CML+TUUumDe8einfefjrzSAWD/eiClHPom5k+iqyLdErFjMexf1757Rywbv77wr8qdOOHof0VqovSdO0Pvmc6mvcGpNTWj1/r2CUQUsW9ghAWw/X7wo/wZpUFUW/RsLHDVYzFI+5an5C7Z5ozvKe+DFlO3MKzO0QMHDXDDZ6XxsqrzRAIGanCOuLulOUFFDNoqhBDoE4ysGIq8SoKrV5TjYnnCtImhOL45Dnjr9eqgB03+zhkDtEc1ar7Y14tPAgqvRYJWRdevUMHAISi93kbPh5SW+WSmG5pV9MIIS9cNO1opJmQdAAMjeOCyPwUrmhOoiypLM0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8fa3eaf6-752f-42cb-476d-08d59db2a8e0 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:41:37.4084 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1062 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 71cfb1e504c4..80aa67df41fd 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c @@ -2010,7 +2010,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"); } /*