Received: by 10.192.165.156 with SMTP id m28csp1223491imm; Wed, 11 Apr 2018 14:59:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx483bH7d0tNaRCuGvVtSd9cS2ZfuwvKz3gwLG9vophK+BY/2pzx+oyEm7+VaGHi62GF2gtvv X-Received: by 2002:a17:902:788e:: with SMTP id q14-v6mr7020436pll.396.1523483942363; Wed, 11 Apr 2018 14:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523483942; cv=none; d=google.com; s=arc-20160816; b=VHnNDuQNnvdFBbXNAHkbjyji8gWsVpAMrg1bPfNfa9OSJpsRQIc/Ejz78tLaK9QxME 2M8phET69Sgw34qtNn5diqPfxlC9ubITbyh205iFfP+Eur9pM3lzuFDu49iuGBi1nR+n 29qjXvB7BouaD6AUBDfaemJ9+XiQLmasqXdvH8S/W6QE6KssN2ICVzHXpohUOzV0Mevf hpFnzo/gid2c5u3kNkQV5B7T3gr66CD2Ft/460J+iADRf7fOsIXKcR+TgBwCqrN6ZCDD 7sv6fjJhuQ3lrB5e2BTPb8B9MI7/4rp1il5AK6G9+QQcM5ULTW4Dxm6SmsJSLvBHB1ih gCgQ== 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=166T+5sSq2G0iGjlZ0OKv0rkP7sdgTe+7n88vSB5my4=; b=wcb1sDfHD6WATMf7Hm9NaRF7E2tkRKgX6uaE2hfey9SntN9xvthZBC+s2tY27bOk21 YJ+kfsQMe3NCtTtOxSSNjEMasCbZCOnxXHm4NrlOwHphy9cILpeXVs18cVs2hb3mTwpa HxikevA7pQEZ/qIRsbN1Xoqjb9cO9f5wcPQN8ZWM1OjFiuMd7I53ND3AxTXsgmfbt624 jZiAG1xHI6l/KZlxdUHnaIcoNr5yUPgA5PVgz5yyuuTQmhYVd6aJXgFBla6X0Y69NviR d2RZ49BBmFsSi5L9lNMPqIOkMxU/+p4hH+XRlKCJG5GHAa31gNXjqfwy7Jg2/SVHbFB+ 4+jQ== 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 q2-v6si1933429plh.259.2018.04.11.14.58.25; Wed, 11 Apr 2018 14:59:02 -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 S1756586AbeDKT53 (ORCPT + 99 others); Wed, 11 Apr 2018 15:57:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36192 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756343AbeDKS5I (ORCPT ); Wed, 11 Apr 2018 14:57:08 -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 6A5ACC06; Wed, 11 Apr 2018 18:57:07 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Sasha Levin Subject: [PATCH 4.9 069/310] USB: ene_usb6250: fix SCSI residue overwriting Date: Wed, 11 Apr 2018 20:33:28 +0200 Message-Id: <20180411183625.289339931@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@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: Alan Stern [ Upstream commit aa18c4b6e0e39bfb00af48734ec24bc189ac9909 ] In the ene_usb6250 sub-driver for usb-storage, the SCSI residue is not reported correctly. The residue is initialized to 0, but this value is overwritten whenever the driver sends firmware to the card reader before performing the current command. As a result, a valid READ or WRITE operation appears to have failed, causing the SCSI core to retry the command multiple times and eventually fail. This patch fixes the problem by resetting the SCSI residue to 0 after sending firmware to the device. Signed-off-by: Alan Stern Reported-and-tested-by: Andreas Hartmann Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/ene_ub6250.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/storage/ene_ub6250.c +++ b/drivers/usb/storage/ene_ub6250.c @@ -1942,6 +1942,8 @@ static int ene_load_bincode(struct us_da bcb->CDB[0] = 0xEF; result = ene_send_scsi_cmd(us, FDIR_WRITE, buf, 0); + if (us->srb != NULL) + scsi_set_resid(us->srb, 0); info->BIN_FLAG = flag; kfree(buf);