Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2513581imm; Thu, 7 Jun 2018 11:57:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLkjMPRipGK5y4msUQimtNaTWlfCqhGhMt33rSsEB2WtyghRNfbzBhQCMwTJXPjfooX0Csu X-Received: by 2002:a63:63c4:: with SMTP id x187-v6mr2562642pgb.9.1528397823100; Thu, 07 Jun 2018 11:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528397823; cv=none; d=google.com; s=arc-20160816; b=dC3GdVG5LcilI6LCYkXW3OH95upSI3+odwFeBS9y41kAO+ADUlhAs8vDEbfXzaOwTx I7F9IXtcTDV+rOYS2h0IaX9r0ns/S5rAPIlQQkf/XCONzxYBqJGqXrX2g7ah5VM5vaWY nHAjf3L92BnhQREkXWAragqQitr8ua+ggKwHjZ1Ru0JpgyQErUUzuI6LURs3lS4RdQ1Y /is/c74a+IKgAw9SUjMQH/bw84B5npaoL2BKHoij+iYm9CRdeS+h3RkUq52eRC64f88Y 41hRWj7xzw3GKKSdL5Q7UmWV0yFQvtjlWZPP4s5z1VqDjZqUgT0AYerdQHjg9AxXFYRe kiSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=OCo+8YrmW8HSjRexJvuLh/Vt+p/OZeTn+T8WgKHshzA=; b=uO2xuirlXHev1dtFsVRpvuTbvrukSR2nSfV7jrsmy6L/7eVclLcCRmVFVwa0kx/3Ke GvI3xgV+becXS7KCC6ftU2Wksld+ZjijWY/GsyR1SeDLzzB8Fo96x/6ThlVG844HCaG8 XAFAnj6F4hNxUhFIeNRrvELvZgVitvDs98R5xv73h8uVLi4VV//mbmTmHhIPCadTgXug TRVNGvW23CkwlcTHSyJ1HWkDMcHowppXvR7Y/Sb7yI1c6tnaUVKl3BFgbcEDkKl4Ogsr EY1qdBe3iNgs1bJGr2Iwb665ql8fAdBx+7L6BbVxu0Sq7rxnBRtpUhb35sbsjsyQJ79y jEmA== 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 62-v6si22012223ply.411.2018.06.07.11.56.49; Thu, 07 Jun 2018 11:57:03 -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; 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 S934553AbeFGP6A (ORCPT + 99 others); Thu, 7 Jun 2018 11:58:00 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:39339 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933051AbeFGOJH (ORCPT ); Thu, 7 Jun 2018 10:09:07 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvb7-0005Zi-K9; Thu, 07 Jun 2018 15:09:05 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb3-0002vl-U0; Thu, 07 Jun 2018 15:09:01 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Arnd Bergmann" , "Martin K. Petersen" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 160/410] scsi: fas216: fix sense buffer initialization In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 96d5eaa9bb74d299508d811d865c2c41b38b0301 upstream. 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: Ben Hutchings --- drivers/scsi/arm/fas216.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c @@ -2009,7 +2009,7 @@ static void fas216_rq_sns_done(FAS216_In * 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"); } /*