From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88EB3C432C3 for ; Wed, 27 Nov 2019 21:39:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5EF5E20869 for ; Wed, 27 Nov 2019 21:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574890764; bh=4lw864Ct5JLJps2WHuqaE8tkLWAdm3FEF5yk1oCmcRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2TpWRV7WrNuKcRT+n7anT7dWT+M/qmJan3usOWdt2rhM5peVOuOzz5KSDZ2AYnzmY S+5Coda2upGeljq96ignVhvsebCwYUml++w9LolIRnmSKj1IdKR0C4+F3Hxa8C8bfc QFhe1EJL3mZqD3k/6NDE58kC028BMaw69pueJ/yg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728020AbfK0VjT (ORCPT ); Wed, 27 Nov 2019 16:39:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:53704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729580AbfK0UoY (ORCPT ); Wed, 27 Nov 2019 15:44:24 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 18C1B217F9; Wed, 27 Nov 2019 20:44:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887463; bh=4lw864Ct5JLJps2WHuqaE8tkLWAdm3FEF5yk1oCmcRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k7H71LlkOjnRwqhMbmBNvib/oGUbiol6YfkkvZtXqKq/cIGLGvshlLiTt/wcLGlMv a5ADEXRdsvrZDygj7IyxqhY11CXMMRzCxLgUwNxpqG5PoKoNcHY9A5Ao+9XHjnLT1l 0Ck2yZf4L8jMAST3pnBnSqEPC/XAKU/7cytlHyu8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum , "David S. Miller" , syzbot+711468aa5c3a1eabf863@syzkaller.appspotmail.com Subject: [PATCH 4.9 122/151] nfc: port100: handle command failure cleanly Date: Wed, 27 Nov 2019 21:31:45 +0100 Message-Id: <20191127203045.103624570@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203000.773542911@linuxfoundation.org> References: <20191127203000.773542911@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Oliver Neukum commit 5f9f0b11f0816b35867f2cf71e54d95f53f03902 upstream. If starting the transfer of a command suceeds but the transfer for the reply fails, it is not enough to initiate killing the transfer for the command may still be running. You need to wait for the killing to finish before you can reuse URB and buffer. Reported-and-tested-by: syzbot+711468aa5c3a1eabf863@syzkaller.appspotmail.com Signed-off-by: Oliver Neukum Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/nfc/port100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/nfc/port100.c +++ b/drivers/nfc/port100.c @@ -791,7 +791,7 @@ static int port100_send_frame_async(stru rc = port100_submit_urb_for_ack(dev, GFP_KERNEL); if (rc) - usb_unlink_urb(dev->out_urb); + usb_kill_urb(dev->out_urb); exit: mutex_unlock(&dev->out_urb_lock);