Received: by 10.192.165.148 with SMTP id m20csp553522imm; Wed, 25 Apr 2018 04:09:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/nB+WwdckU2o4KhID6mxC4u99lDeLH0CgYDJXACms+BULHd/ieFOdghOXH/Z2c9dV2cPd1 X-Received: by 2002:a17:902:57c7:: with SMTP id g7-v6mr28619211plj.222.1524654591294; Wed, 25 Apr 2018 04:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524654591; cv=none; d=google.com; s=arc-20160816; b=K3A5fHprUMq56uW3kexLrlGoD62T0EQ5jysby37KgTli0z3Dg3XWOclxeca9rihnOO a9qk440A7I7LpQ0JP+PpeisMhwZjVwp+YXGltcKty02ermN8bPrXts6a0jHMscy/kg+l +XIpSkHjU3iAzDky9L1aIJmRfA8qHnxiJA639ycH26VKbc7A1JMpqeeWPYX3q+VBMynR mmLo716Xp9VcnSMg0dP40mfP3l+g9+Ec7vGtLtxT6jOdALHA0I53Sioh3e9G58JpuyEe aQMmkUXTkGpiPVlX5SmmZe+UXnFYYC9CsPjZBzW9URacSmu0jaImNY+ne9G+fmo5Nyvm sqxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ObckVYM3tfrFxrjjkiEMrxv+6kiKeyWDL5657xqSA7I=; b=0dtEWv0jgPZ0VPZDtaYrwLchUT8TiVa1FVEDZNiqrVaJIuggecmhACee+HkZbK1vwG BDtb6GGqQJP57PxMHqu+GP2IUjwe/k2TL7HDxFuERun8YLIFbjd+N15KpL2/FpLIiorK Qf+6T5M73iXKX4vk28W5B6xxEJvwgZGQLp2I5JhhHF53F8pc4y2mnDGuq8rSXHqrK97x 2nTfnx9mJfoPlDlta05b2p9K9b8RLbPKVLGppHdmk+xXIQwOC2n8OICGmWcN0YXlx32g HWIqeY4ukNetpIAsOB+99MeSgXsNzoQOstPE/mG/8xsvh6WWP48jO4oE8nrsz+gucaCk SRiA== 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 a123si13545936pgc.43.2018.04.25.04.09.37; Wed, 25 Apr 2018 04:09:51 -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 S1754056AbeDYLH3 (ORCPT + 99 others); Wed, 25 Apr 2018 07:07:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52412 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753983AbeDYKle (ORCPT ); Wed, 25 Apr 2018 06:41:34 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4AAD736; Wed, 25 Apr 2018 10:41:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 072/183] scsi: fas216: fix sense buffer initialization Date: Wed, 25 Apr 2018 12:34:52 +0200 Message-Id: <20180425103245.413959802@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- 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 @@ -2011,7 +2011,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"); } /*