From patchwork Thu Jan 18 13:16:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 124948 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp121963lja; Thu, 18 Jan 2018 05:17:19 -0800 (PST) X-Google-Smtp-Source: ACJfBotm3SmmNQD0AFBFvkFTJ59G/T1qzJjrfhvCBc15WzwUB6M70iwMmNfRnf/7DHb3il5oiO44 X-Received: by 10.98.88.198 with SMTP id m189mr40916528pfb.171.1516281439247; Thu, 18 Jan 2018 05:17:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516281439; cv=none; d=google.com; s=arc-20160816; b=UxTO4Q0CR7I1gmMi+pX+/w7KL3L2V0GhZhUd3xJoq5xc//SGgMLLwIqHHDURNHMPIl 9boPSvx/BkfrNbasXp1DGvZG3NprB6NvSRrnLbyWZc/wbDR1rCpEVH9mEisRflZpVsyW Kbhj8RWcTU4ZaXee/KgoQCwfVDBHGBnJ1iSSZVJUyHjngw4OttT2KT98rJlAuSRYeOb2 d1eCBmJJOiYEUPRc5GIs7B1dLKicqsbCaGWf3mxFzH9NA3se2cC9aooyZcSbyyp3VNzl Nfla/HxMO4mIJXhCekHcoTE8FA/CiFt0pCxJ0i45EYH7VM1sb9xhLpGSBFzeYT9j6I0A AtZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=mVNuCtb3nNzM6vRlqfTKVowJuI9+e56u7akKj7dt4wg=; b=yuyie6IVBs2kx8ygbNIMRud0/Uu7zhxp0V3BtslxRUgowXXzRU8k5vln+aLqeFAs8k yAWgSL4WJqg7enGo7enVARVqu3/e/Mq70J8q1zo6D0lvQltVV6L48VKUIUC5SmNTGwuv MFaIdMAIVZkISBQVoZM+jqxu6uvRpKvz50fNfX6sRwZj4bsqPay022gUpaC6BASubuiY B1tTLKj1VM1KIoYkzBhigBoX+ffzGejG4j4Kd/Jjpyjg8qqziG6/7PUCXMt/Q2GNMrVI 51YvHvqiOm0MRpT5sZYpiAbjddcXfiaSRLtVyaxA/1Pgp8M4LUqP3GtYnPbcu56HsvZR DZWg== 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 f13si6787870pfj.28.2018.01.18.05.17.18; Thu, 18 Jan 2018 05:17:19 -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 S1756201AbeARNRS (ORCPT + 28 others); Thu, 18 Jan 2018 08:17:18 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:51870 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756185AbeARNRQ (ORCPT ); Thu, 18 Jan 2018 08:17:16 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LaDAk-1f6I9q0r7e-00m5a2; Thu, 18 Jan 2018 14:16:52 +0100 From: Arnd Bergmann To: Russell King , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: fas216: fix sense buffer initialization Date: Thu, 18 Jan 2018 14:16:38 +0100 Message-Id: <20180118131650.893849-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:BfTCuyOWDdSBbfN3Tuys4harYFrEyrMzqArUv+MvB4pVacHLkA9 s61IWxWQXb06S0UY0eav7QYzys8dqlNpEBsbUV+KOW7twqicFglp0aLRDifeBRfuejRtYRW 0F20lbyh5Vw6T4MEJrHOfOOzBJ7q+a6U6PmnsZIlrT7phr0zz6CeweEE4T68CT2lwZWLx+q 34RqY9GopBPsJMGKGc4JA== X-UI-Out-Filterresults: notjunk:1; V01:K0:QAP+3jxeUW0=:xvc4dZhusYipmdW3esyaxY I5ikwKdbSlCYg3Vwp3/Gqf09qeTl9dqKrvtbwOIRs9iQEplgNJpnOKq9M4huSmXkoetYKtMsj WmWC0v2Z3dC1i+yOkOlzBgC4buhEk//Tz5YcTSDJhHWfIXmbTSl0DJTx5iOHGhgbst86MSlzU 4BXgctTiYDsA9Ckc5a/F5St2Asm1brK22xWj7IRmWJVG2sg+1/aaNlxG0IbiVkJsVAGrJZdBO 8qVs0fdvehf2ZSWY0oQxcWcCqmvmksZ0mhNNEOO7MuLd7+1neuMz+TbIHYFywJQWQyEARG95F UPyfDrwrwghlYbudk6xxL5ccugd/vLVuH1cS9mOm/kQdC6xRcsQUPgbhfi70Cys76y5bU4PKD /U8xPywtsplOM2D/DGjgqrsRA713jquun1T/Z3CRCGMdL2s4PFk2VwHpCOs6aUP/zNEY2p1km 2UOYeawAMwqAze2iLFGfQuLF7sOtNYREuoIUf8/AN7I6T/cmW58ulY20eYhFhy1w7TFTDJvMf zzG0Qkc85y31zAA0VHsSS7zL6f0CwZL5guLuWfa8K7V7iFTwB5nCU3Yq5ILgzIUcBaKU7s4bJ iByyQYqIFooVUKL2eAFulGQs4y9G2Vttb72UJYrCg4kWFh9qZs1v1Zcjh50ayQe4lBiz7MihY 0EP0/JI4I8YX2a5jR4RF72f8w5pJKGs1wkcL/ZeG1ZRRIb4wKieU45PEA7dnbhWkgjA5QtfK3 8cGhi8UKGbJIB5iev5UdCpCpXDXsCI+O2H50aA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/scsi/arm/fas216.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 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"); } /*