<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">在 2021/8/5 下午3:58, Jiri Slaby 写道:<br>
</div>
<blockquote type="cite"
cite="mid:0f26a1c3-53e8-9282-69e8-8d81a9cafc59@kernel.org">Hi,
<br>
<br>
On 04. 08. 21, 4:54, Xianting Tian wrote:
<br>
<blockquote type="cite">@@ -933,6 +949,16 @@ struct hvc_struct
*hvc_alloc(uint32_t vtermno, int data,
<br>
hp->outbuf_size = outbuf_size;
<br>
hp->outbuf = &((char *)hp)[ALIGN(sizeof(*hp),
sizeof(long))];
<br>
+ /*
<br>
+ * hvc_con_outbuf is guaranteed to be aligned at least to
the
<br>
+ * size(N_OUTBUF) by kmalloc().
<br>
+ */
<br>
+ hp->hvc_con_outbuf = kzalloc(N_OUTBUF, GFP_KERNEL);
<br>
+ if (!hp->hvc_con_outbuf)
<br>
+ return ERR_PTR(-ENOMEM);
<br>
</blockquote>
<br>
This leaks hp, right?
<br>
<br>
BTW your 2 patches are still not threaded, that is hard to follow.
<br>
</blockquote>
<p>yes, thanks, I found the bug, I am preparing to do this in v4.<span
style="color: rgb(51, 51, 51); font-family: Arial, sans-serif;
font-size: 13px; font-style: normal; font-variant-ligatures:
normal; font-variant-caps: normal; font-weight: 400;
letter-spacing: normal; orphans: 2; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); text-decoration-style:
initial; text-decoration-color: initial; display: inline
!important; float: none;"><br>
</span></p>
<p>It is the first time I send series patches(number >1), I
checked the method for sending series patch on LKML.org, I should
send '0/2' which is the history info for series patches. <br>
</p>
<p>I will add 0/2 in v4, sorry again for this:(</p>
<p>beside avove things, the solution in this patch is for you?
thanks <br>
<span style="color: rgb(51, 51, 51); font-family: Arial,
sans-serif; font-size: 13px; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); text-decoration-style: initial; text-decoration-color:
initial; display: inline !important; float: none;"></span></p>
<blockquote type="cite"
cite="mid:0f26a1c3-53e8-9282-69e8-8d81a9cafc59@kernel.org">
<br>
<blockquote type="cite">+
<br>
+ spin_lock_init(&hp->hvc_con_lock);
<br>
+
<br>
tty_port_init(&hp->port);
<br>
hp->port.ops = &hvc_port_ops;
<br>
</blockquote>
<br>
thanks,
<br>
</blockquote>
</body>
</html>