Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2021647imm; Thu, 24 May 2018 04:39:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoHyCX6wBSHGNyG41xbsqPIFCBkVLwkq1OTET+L3HeipZceJk6psYun+UCIZZvn38+dZhEq X-Received: by 2002:a65:6005:: with SMTP id m5-v6mr5608412pgu.241.1527161993524; Thu, 24 May 2018 04:39:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527161993; cv=none; d=google.com; s=arc-20160816; b=ArWaHFqEHFXrr1Vorr3wbbzUCgjhOIHkWNDCJtnCRj/HWksmSS6MflIXwOCp7j3kFj CaEJnnryZto4Swcjn5FGRKTCzpHTTmbuDqRBt7lbmIZi2RJr5IvXrGkofP697kOMJLV6 5m8k4P7S7bxoQPzhnLX51T8ZF2/o6j5UJZ0pgNoIqZOOHOR41reEiuu+9Xu6w6KDC1sJ 8OQUIGOT5dxDgCDfwQ1Mh/1MOpVVxstuyRb52IPlZXJuPZ5UHPDZMcMisFpqFosxpcNv 8Pp/6NWga9TaKE/YBZCD/sJvMr3HuINCFigmsuWufRtQw4ikThZsGaAg1VC/zxHaUUc1 JvaQ== 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:dkim-signature :arc-authentication-results; bh=Lhwo0Is2btd2FrUindojBb68qzzhwQOrgEut/EhhAS4=; b=wxL7Bq7T8MOiud3d6wEpQy1WmA1DyM32i5dICr8MSBiMe3a/2AwPuGKyoDNJa+LpG4 4y1sfFGw6B8ZJZhTdx+TQK4OLZ3VkzIgmF7vL5l3boDo9zoUe/h8UdEfVkNAnNRcmRjX MOoMURxjXZIzeYEEtsuzvWxiCQn70B00touBNkaoqcrC1Nwmq4D9AD2pi5DPqBsHtsby 3mxwjcMu2JuOrBk6XtMVHR8U4GUKZC5i42HTBoW161VDhCd6JQqNUfBqShv0DB1P3hUT /yMfsl79qOdREGICeDAjxtdl+WlHiBYign3pWZUfwJfJCyMcAa5xHQUZiJDxsvbUxAJL DY/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pHNiL6z/; 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 p23-v6si16495568pgv.153.2018.05.24.04.39.38; Thu, 24 May 2018 04:39:53 -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=@kernel.org header.s=default header.b=pHNiL6z/; 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 S967328AbeEXJtK (ORCPT + 99 others); Thu, 24 May 2018 05:49:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:36110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967308AbeEXJtD (ORCPT ); Thu, 24 May 2018 05:49:03 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 69B0F2089B; Thu, 24 May 2018 09:49:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155342; bh=iF3gVTwJ9Chc9U2NC8vDOPAhGMz0OTzbKDcKq0IKtzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pHNiL6z/5rP062smZtqrr5/JH5OPagzJRF+CA3j5Ak0EnSdp1I2oXmTXrF/wzYePT PU6bMO+yLSQz86iCrbNKUV7XsUqVNf3lWieaKfETIagPkVpuyQXe21MsRZVfOSiOAV LT5csD4UNeY6BwNtw7fcQDXwcp7vRC7Q8e2vTb90= 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.9 51/96] scsi: fas216: fix sense buffer initialization Date: Thu, 24 May 2018 11:38:34 +0200 Message-Id: <20180524093608.403952441@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@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.9-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"); } /*