lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1497288375-3559-6-git-send-email-tal.shorer@gmail.com>
Date:   Mon, 12 Jun 2017 20:26:12 +0300
From:   Tal Shorer <tal.shorer@...il.com>
To:     linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-usb@...r.kernel.org, gregkh@...uxfoundation.org,
        balbi@...nel.org, corbet@....net
Cc:     Tal Shorer <tal.shorer@...il.com>
Subject: [PATCH 5/8] usb: gadget: f_acm: initialize port_line_coding when creating an instance

Initialize acm->port_line_coding with something that makes sense so
that we can return a valid line coding if the host requests
GetLineCoding before requesting SetLineCoding

Signed-off-by: Tal Shorer <tal.shorer@...il.com>
---
 drivers/usb/gadget/function/f_acm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c
index e023313..b7a1466 100644
--- a/drivers/usb/gadget/function/f_acm.c
+++ b/drivers/usb/gadget/function/f_acm.c
@@ -763,6 +763,12 @@ static struct usb_function *acm_alloc_func(struct usb_function_instance *fi)
 	acm->port.func.unbind = acm_unbind;
 	acm->port.func.free_func = acm_free_func;
 
+	/* initialize port_line_coding with something that makes sense */
+	coding.dwDTERate = cpu_to_le32(9600);
+	coding.bCharFormat = USB_CDC_1_STOP_BITS;
+	coding.bParityType = USB_CDC_NO_PARITY;
+	coding.bDataBits = 8;
+
 	return &acm->port.func;
 }
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ