From patchwork Sun Sep 30 16:03:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10621441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2285C14BD for ; Sun, 30 Sep 2018 16:03:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F76D2927C for ; Sun, 30 Sep 2018 16:03:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F36C629287; Sun, 30 Sep 2018 16:03:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 852442927C for ; Sun, 30 Sep 2018 16:03:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728528AbeI3WhX (ORCPT ); Sun, 30 Sep 2018 18:37:23 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:33269 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728380AbeI3WhX (ORCPT ); Sun, 30 Sep 2018 18:37:23 -0400 Received: by mail-lf1-f68.google.com with SMTP id o21-v6so8126722lfe.0 for ; Sun, 30 Sep 2018 09:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9ZKbxREz0T+clR+jw4EuNLxg1Ue9lnEU505RjYPvR4A=; b=LBcdk/BrPKM383kU9ef8xWJcs1wEemut3gB9L0i7eYf92fyEnJr6fqdVolDEgPa6Gn CNyaPqQn6KnmHggMb4Q0z+WYd2RdVbToW4eE/yeASrC7UaQQdBslk1zeo9ps1UTFPw8G I9Ew9Qmrvv5i/6B9vrhiAPNgGD0Ow8/xLyHL6M0gCQd+ffIP0o0ZvLnadP/OwvJUedwF SgfWL4JdizUSj0thURPZnt2i+QeRSvMPrtB1Bk5nJVa2lo+mMPS4AiBdIn76aIHQVyn/ bY7V2WLvDvaG/yv9+FPWBEoi1MTGxqlOVd//PDa0MQNxgFILyL9XWOagrbiUGSIqS1jc 1H+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=9ZKbxREz0T+clR+jw4EuNLxg1Ue9lnEU505RjYPvR4A=; b=Mz43IAYsfTgwosDksK2HXUDGs++jXUT9R3jsTdCZ6dUGFTH37fYDmx07A3Ka2f5j7D i79gnGVgPPMTKshieAaXTrv6+GL+9dAr8owF8GlYgasnOGiuclgNOclYbLWWPKrbsBj/ lKMhx+yVf0eIh1lGL+Z8r4B8nTtJuvlyS90eU3UzPco5XSAcD9zn/4XkN0b1dIJ/tiKd lYOIsf1LfYr8qIwKPyM6YJVcHJRxkYaZx1FgkXfdc+TzUSO9IAjvvkKxCKGHSQgiRayQ I1cOvocL49tYsP5uMheJ66uj5g0EZ06p36owYzBawQ993iLC4ywBtCUZ6mSD4NbXHdqd J5Xg== X-Gm-Message-State: ABuFfoiIaVOxeslWAPrIgIQ4CSS8pTnUc2Qlr7A0SdR0u2ze1+mYbNlC L5cqqO3Tvwq+Qaw3UrV2RsW51paF X-Google-Smtp-Source: ACcGV60IQYwh0r7xMyDc0kBVoptIRBcvskGWvGFXt+ZfIIb6biBPJnsGaQqJySETdmFAxcnvcutV3Q== X-Received: by 2002:a19:2a12:: with SMTP id f18-v6mr3649207lfl.28.1538323425671; Sun, 30 Sep 2018 09:03:45 -0700 (PDT) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id c4-v6sm2139400lfc.35.2018.09.30.09.03.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 09:03:44 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1g6eC8-0008U3-84; Sun, 30 Sep 2018 18:03:44 +0200 From: Johan Hovold To: linux-usb@vger.kernel.org Cc: YueHaibing , Johan Hovold Subject: [PATCH] USB: serial: cypress_m8: fix interrupt-out transfer length Date: Sun, 30 Sep 2018 18:03:11 +0200 Message-Id: <20180930160311.32569-1-johan@kernel.org> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix interrupt-out transfer length which was being set to the transfer-buffer length rather than the size of the outgoing packet. Note that no slab data was leaked as the whole transfer buffer is always cleared before each transfer. Fixes: 9aa8dae7b1fa ("cypress_m8: use usb_fill_int_urb where appropriate") Signed-off-by: Johan Hovold --- drivers/usb/serial/cypress_m8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 31c6091be46a..5aaab8f4dd8f 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -769,7 +769,7 @@ static void cypress_send(struct usb_serial_port *port) usb_fill_int_urb(port->interrupt_out_urb, port->serial->dev, usb_sndintpipe(port->serial->dev, port->interrupt_out_endpointAddress), - port->interrupt_out_buffer, port->interrupt_out_size, + port->interrupt_out_buffer, actual_size, cypress_write_int_callback, port, priv->write_urb_interval); result = usb_submit_urb(port->interrupt_out_urb, GFP_ATOMIC); if (result) {