Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2487132imm; Mon, 28 May 2018 09:01:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqE3MuzdvaqOYX4D2pJNklyfR9AJpCJTjbgDoR9B/qWs5S5scXcrVoVvFVe04vQroycB0yj X-Received: by 2002:a62:9f15:: with SMTP id g21-v6mr13748145pfe.207.1527523299935; Mon, 28 May 2018 09:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527523299; cv=none; d=google.com; s=arc-20160816; b=hLKEkR/1aDaPvBNICeK/63FOy/PYoRuCZ84Rs8H3IH5b5Tq3DDMVcw1GghQBNL+rzJ zVPSjRVb9EU5VQJvX5Uy21rgWfupj0VN6KmUoEJwl5hlzgAgkqlNfj33LFcYcowJUheZ VvcUinYZJ6r+S1OhCsc9RrYV73Is+tgMjyDMU0e68kbQvLCgmsi4qCTJXvYBNX6P3Z7w MahyMftMjguPrS4BaQBlE1Z0Hvv5dxzoO0fIWUAvwgZb4v4aGqpzqaBaNiY0G5SmO90p lfeAxnvfpgunY4BoHd8uobjAV3iTXdqBdR+LQU5gTk5PC9TV0Fmv0yqT4hN2Oa2/dcoH tA0Q== 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=FtVyZyG8OhIF9c6J1ag1mvr/G06626Ynnsk6uwrWUGA=; b=ZPujJoq1aWI46Xgqe6MyvKrsQlFOZ87gqlw8ffEg3ccH6gbFAls/kLOwaN7AsQQF9Q xcuCCYIcwhVoPFOWAxO1sV51oMWLDAXQOcBvTdds9mKNH5CLZLK8nGgJJjHeTJed0RTY CnowQywlE6k001t/noW2pM19JNWbW06CFOeysisaMCKbUOdQSpjU2QjFuBedt1CeHdA7 +rmStEMJ+A0L0B5WwuQ8cuezcb6c+19MFtaICatkAyPk6OTyuMH7bqHtdUvE0jIq2r1p NtnNPycQErwNU/oEledfNpAFZTLY/GXjrq3sSCqMlRTMTtyf5QZNZmGQ5K6sD3N1abfP E0NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Mg2wivms; 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 u133-v6si8644658pgb.357.2018.05.28.09.01.24; Mon, 28 May 2018 09:01:39 -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=Mg2wivms; 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 S1754626AbeE1QAo (ORCPT + 99 others); Mon, 28 May 2018 12:00:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:35898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936934AbeE1KPq (ORCPT ); Mon, 28 May 2018 06:15:46 -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 33E80206B7; Mon, 28 May 2018 10:15:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502545; bh=UO1TaodgJU2zZjGGdxad2ZG1dvU0Pu/PNeaHZ7cAl0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mg2wivmsbI3GvLjf/zeuvfOCXRcsJLlf5OX3iF5UhFD0CupJA7nTOt7XPr4FXunNI r99YaL92YeeWNH0LA8Gkk89dy3PXdpCCUq1B2n5hPngjW+I5H8OCOGDEBZIQwoQDco rEA9jcyZzJL08I5cTCn/xctzcVZBKOOFnhKaMxr8= 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.4 039/268] scsi: fas216: fix sense buffer initialization Date: Mon, 28 May 2018 12:00:13 +0200 Message-Id: <20180528100206.481220518@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100202.045206534@linuxfoundation.org> References: <20180528100202.045206534@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.4-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 @@ -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"); } /*